:root {
  --primary:      #1D4ED8;
  --primary-dark: #1E3A8A;
  --primary-light:#EFF6FF;
  --success:      #16A34A;
  --warning:      #D97706;
  --danger:       #DC2626;
  --bg:           #F8FAFC;
  --card-bg:      #FFFFFF;
  --text:         #1E293B;
  --text-muted:   #64748B;
  --border:       #E2E8F0;
  --radius:       14px;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 40px rgba(29,78,216,.15);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

/* ──── HERO ──────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #3B82F6 100%);
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  max-width: 550px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}
.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.hero-stat {
  text-align: center;
}
.hero-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #FCD34D;
  line-height: 1;
}
.hero-stat-label {
  font-size: .75rem;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ──── CALCULATOR CARD ────────────────────────── */
.calc-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  z-index: 10;
}
/* Hero overlap — only when calc-card is a direct child of .container */
.container > .calc-card {
  margin-top: -40px;
}
/* Never overlap in sidebars, rows, or panels */
.col-lg-4 .calc-card,
.col-md-4 .calc-card,
.row .calc-card {
  margin-top: 0;
}
.calc-tabs {
  display: flex;
  background: #F1F5F9;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.calc-tab {
  flex: 1;
  min-width: 120px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  text-align: center;
}
.calc-tab:hover { background: rgba(29,78,216,.05); color: var(--primary); }
.calc-tab.active {
  background: var(--card-bg);
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
}
.calc-tab i { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.calc-body { padding: 28px 32px; }
@media (max-width:576px) { .calc-body { padding: 20px 16px; } }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Calc card header (pill-style tabs bar) ── */
.calc-header {
  background: #F1F5F9;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Tab-btn pill style (used by new tool pages) ── */
.tab-btn {
  padding: 8px 18px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29,78,216,.25);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* hero-stat-val alias for hero-stat-num */
.hero-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #FCD34D;
  line-height: 1;
  display: block;
}
@media (max-width:768px) { .hero-stat-val { font-size: 1.3rem; } }

.calc-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.calc-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color .2s;
  background: #FAFAFA;
}
.calc-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.btn-calc {
  background: linear-gradient(135deg, var(--primary), #3B82F6);
  color: #fff;
  border: none;
  padding: 14px 36px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: transform .15s, box-shadow .15s;
  letter-spacing: .3px;
}
.btn-calc:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29,78,216,.35);
}
.btn-calc:active { transform: translateY(0); }

/* ──── RESULT BOX ─────────────────────────────── */
.result-box {
  display: none;
  margin-top: 20px;
  border-radius: 12px;
  padding: 20px 24px;
  text-align: center;
  animation: fadeInUp .3s ease;
}
.result-box.show { display: block; }
.result-box.success { background: #F0FDF4; border: 2px solid #86EFAC; }
.result-box.warning { background: #FFFBEB; border: 2px solid #FCD34D; }
.result-box.danger  { background: #FEF2F2; border: 2px solid #FECACA; }

.result-percent {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}
.result-box.success .result-percent { color: var(--success); }
.result-box.warning .result-percent { color: var(--warning); }
.result-box.danger  .result-percent { color: var(--danger); }

.result-label {
  font-size: .9rem;
  font-weight: 600;
  margin-top: 6px;
}
.result-detail {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.result-progress {
  height: 10px;
  border-radius: 5px;
  background: #E2E8F0;
  overflow: hidden;
  margin-top: 14px;
}
.result-progress-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* ──── SECTION STYLES ─────────────────────────── */
.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
  position: relative;
}
.section-title span { color: var(--primary); }
.section-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}

.info-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow .2s, transform .2s;
}
.row .info-card { height: 100%; }
.info-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.info-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

/* ──── FORMULA BOX ────────────────────────────── */
.formula-box {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border: 2px solid #93C5FD;
  border-radius: var(--radius);
  padding: 24px 32px;
  text-align: center;
}
.formula-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  font-family: 'Courier New', monospace;
  letter-spacing: .5px;
}

/* ──── ATTENDANCE SCALE ───────────────────────── */
.scale-bar {
  height: 24px;
  border-radius: 12px;
  background: linear-gradient(to right, #DC2626 0%, #F97316 40%, #EAB308 60%, #16A34A 75%, #15803D 100%);
  position: relative;
  margin: 12px 0;
}
.scale-marker {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.scale-marker::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--primary-dark);
}

/* ──── FAQ ────────────────────────────────────── */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 20px;
  text-align: left;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-q:hover { background: var(--primary-light); color: var(--primary); }
.faq-q .faq-icon { color: var(--primary); font-size: .8rem; transition: transform .2s; }
.faq-q.open .faq-icon { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.faq-a.open { display: block; }

/* ──── TABLE ──────────────────────────────────── */
.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.attendance-table th {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.attendance-table th:first-child { border-radius: 10px 0 0 0; }
.attendance-table th:last-child  { border-radius: 0 10px 0 0; }
.attendance-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.attendance-table tr:nth-child(even) td { background: #F8FAFC; }
.attendance-table tr:hover td { background: var(--primary-light); }
.badge-safe    { background:#D1FAE5; color:#065F46; padding:3px 10px; border-radius:50px; font-size:.78rem; font-weight:700; }
.badge-warn    { background:#FEF3C7; color:#92400E; padding:3px 10px; border-radius:50px; font-size:.78rem; font-weight:700; }
.badge-danger  { background:#FEE2E2; color:#991B1B; padding:3px 10px; border-radius:50px; font-size:.78rem; font-weight:700; }

/* ──── UNIVERSITY TABS ────────────────────────── */
.uni-pill {
  background: var(--border);
  color: var(--text-muted);
  border: none;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.uni-pill:hover  { background: var(--primary-light); color: var(--primary); }
.uni-pill.active { background: var(--primary); color: #fff; }
.uni-panel { display: none; }
.uni-panel.active { display: block; }

/* ──── BREADCRUMB ─────────────────────────────── */
.breadcrumb-section {
  background: var(--primary-light);
  padding: 10px 0;
  border-bottom: 1px solid #DBEAFE;
}
.breadcrumb { margin: 0; font-size: .83rem; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ──── FOOTER ─────────────────────────────────── */
.footer-main {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}
.footer-link {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: color .2s;
}
.footer-link:hover { color: #FCD34D; text-decoration: none; }

/* ──── NAVBAR ACTIVE ──────────────────────────── */
.active-nav {
  color: #fff !important;
  background: rgba(255,255,255,.12) !important;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,.7);
}
/* Dropdown toggles: no inset shadow (caret area conflicts) */
.active-nav.dropdown-toggle {
  box-shadow: none;
  border-bottom: 2px solid rgba(255,255,255,.7);
}

/* ──── ANIMATIONS ─────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp .4s ease; }

/* ──── STEP BOXES ─────────────────────────────── */
.step-num {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  flex-shrink: 0;
}

/* ──── RICH RESULT COMPONENTS ────────────────── */
.result-progress-wrap {
  background: #E2E8F0;
  border-radius: 20px;
  height: 18px;
  position: relative;
  overflow: visible;
  margin: 16px 0 24px;
}
.result-progress-fill {
  height: 100%;
  border-radius: 20px;
  transition: width .7s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.result-progress-fill.success { background: linear-gradient(90deg,#16A34A,#22C55E); }
.result-progress-fill.warning { background: linear-gradient(90deg,#D97706,#F59E0B); }
.result-progress-fill.danger  { background: linear-gradient(90deg,#DC2626,#EF4444); }
.result-progress-marker {
  position: absolute;
  top: -8px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.result-progress-marker-line {
  width: 2px;
  height: 34px;
  background: #334155;
  opacity: .5;
}
.result-progress-marker-label {
  font-size: .62rem;
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
  margin-top: 2px;
}
.result-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.result-stat-card {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.result-stat-val {
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 4px;
}
.result-stat-lbl {
  font-size: .7rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.recovery-plan {
  margin-top: 12px;
  padding: 12px 16px;
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
  border-radius: 10px;
  font-size: .82rem;
  line-height: 1.6;
}
.recovery-plan.safe {
  background: #F0FDF4;
  border-color: #86EFAC;
}
.result-main-highlight {
  margin: 14px 0;
  padding: 14px;
  background: linear-gradient(135deg,#FEF2F2,#FEE2E2);
  border: 2px solid #FECACA;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
}
.result-main-highlight .big-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: #DC2626;
  line-height: 1;
}
.result-main-highlight.safe-hl {
  background: linear-gradient(135deg,#F0FDF4,#DCFCE7);
  border-color: #86EFAC;
}
.result-main-highlight.safe-hl .big-num { color: #16A34A; }

/* ──── UNIVERSITY PILLS & PANELS ─────────────── */
.uni-selector {
  padding: 32px 0 36px;
  background: #fff;
  border-bottom: 3px solid var(--border);
}
.uni-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: #fff;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.uni-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.uni-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.uni-panel {
  display: none;
}
.uni-panel.active {
  display: block;
}
/* Override global hero-overlap margin */
.uni-panel .calc-card {
  margin-top: 0;
}

/* ──── BLOG ARTICLE LAYOUT ───────────────────── */
.article-hero {
  background-color: var(--primary-dark);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #3B82F6 100%);
  padding: 48px 0 80px;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.article-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: rgba(255,255,255,.75);
}
.article-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(255,255,255,.15);
  color: #fff;
}
.article-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}
.article-body {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 -4px 0 var(--primary), var(--shadow-lg);
  position: relative;
  z-index: 10;
  padding: 40px 48px;
  margin-top: 0;
}
@media (max-width: 768px) {
  .article-body { padding: 24px 20px; }
  .article-hero  { padding: 32px 0 60px; }
}
.article-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}
.article-body p {
  color: #374151;
  line-height: 1.8;
  margin-bottom: 16px;
}
.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.article-body li {
  color: #374151;
  line-height: 1.8;
  margin-bottom: 6px;
}
.article-body strong { color: var(--text); }
.article-toc {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 32px;
}
.article-toc-title {
  font-weight: 800;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  margin-bottom: 10px;
}
.article-toc a,
.article-toc > a {
  display: block !important;
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: none !important;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  transition: color .15s;
}
.article-toc a:last-child { border-bottom: none; }
.article-toc a:hover,
.article-toc > a:hover { color: var(--primary); }
.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 36px 0;
}
.article-share-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
}
.share-btn:hover { opacity: .85; }
.share-btn-wa  { background: #25D366; color: #fff; }
.share-btn-tw  { background: #1DA1F2; color: #fff; }
.share-btn-copy{ background: #F1F5F9; color: var(--text); }
.article-related {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}
.article-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.article-related-card {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
  display: block;
}
.article-related-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(29,78,216,.1);
  color: inherit;
}
.article-cta {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border: 2px solid #93C5FD;
  border-radius: 14px;
  padding: 24px;
  margin: 32px 0;
  text-align: center;
}
.article-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #3B82F6);
  z-index: 9999;
  transition: width .1s;
}

/* ──── RESPONSIVE TWEAKS ──────────────────────── */
@media (max-width:768px) {
  .hero-section { padding: 40px 0 60px; }
  .hero-stats { gap: 16px; }
  .hero-stat-num { font-size: 1.3rem; }
  .calc-tabs { font-size: .75rem; }
}
