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

/* ============================================================
   RPE Design System — Single CSS file for the entire app
   ============================================================ */

:root {
  /* RPE Brand Palette */
  --primary: #1A2E1A;
  --primary-light: #2A4A2A;
  --accent: #4CAF50;
  --accent-hover: #66BB6A;
  --accent-glow: rgba(76, 175, 80, 0.15);
  --gold: #E8C840;
  --bg-gradient: linear-gradient(160deg, #1A2E1A 0%, #1B6B3A 50%, #1A2E1A 100%);
  --surface: #ffffff;
  --surface-alt: #f7faf7;
  --border: #dce8dc;
  --border-light: #edf5ed;
  --text: #1A2E1A;
  --text-muted: #5a6e5a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 50px;
  --c-green: #1B6B3A;
  --c-indigo: #4A5899;
  --c-amber: #C8A415;
  --c-rose: #B8372E;
  --c-teal: #2E8B7A;
  --c-sky: #3A7CB8;
}

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

body {
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  background: var(--surface-alt);
  min-height: 100vh;
  direction: rtl;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== SVG Icons ===== */
.ico { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ico-lg { width: 24px; height: 24px; }

/* ===== Navbar ===== */
.nav-wrap {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  position: relative;
}
.nav-brand {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 18px 12px 24px;
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid rgba(255,255,255,0.08);
}
.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  padding: 13px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-links a:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.04);
}
.nav-links a.active {
  color: #fff;
  border-bottom-color: var(--accent);
  font-weight: 700;
  background: rgba(76,175,80,0.08);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 10px;
  margin-right: auto;
  line-height: 1;
}

/* ===== Page Title Bar ===== */
.page-title-bar {
  background: var(--bg-gradient);
  color: #fff;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.page-title-bar h1 {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title-bar .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-light {
  background: rgba(255,255,255,0.12);
  color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.btn-light:hover { background: rgba(255,255,255,0.25); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-glow); }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-content { max-width: 1400px; margin: 0 auto; padding: 24px 20px 40px; }

/* ===== Section Title ===== */
.sec-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.sec-title::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(to left, transparent, var(--border));
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ===== Stats Bar ===== */
.stats-bar {
  background: var(--surface);
  padding: 14px 24px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--accent);
}
.stat-item strong {
  color: var(--accent);
  font-size: 1.05rem;
}

/* ===== Filters Bar ===== */
.filters-bar {
  background: var(--surface);
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-alt);
  outline: none;
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.filter-select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--accent); }

/* ===== Table ===== */
.table-container { overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
thead { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 10; }
th { padding: 13px 12px; text-align: right; border-bottom: 2px solid rgba(76,175,80,0.3); font-weight: 600; font-size: 0.78rem; }
tbody tr:hover { background: #f0f9f2; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.tag {
  background: var(--surface-alt);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 2px 9px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  display: inline-block;
}
.file-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  padding: 5px 12px;
  background: rgba(76,175,80,0.08);
  border-radius: var(--radius-full);
  border: 1px solid rgba(76,175,80,0.2);
  font-size: 0.78rem;
  white-space: nowrap;
}
.file-link:hover { background: rgba(76,175,80,0.15); }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  flex-wrap: wrap;
}
.pagination button {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  transition: all 0.2s;
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Color Utilities ===== */
.bg-green { background: var(--c-green); }
.bg-indigo { background: var(--c-indigo); }
.bg-amber { background: var(--c-amber); }
.bg-blue { background: var(--accent); }
.bg-teal { background: var(--c-teal); }
.bg-rose { background: var(--c-rose); }
.bg-green:hover { background: #145A2E; box-shadow: 0 4px 16px rgba(27,107,58,.3); }
.bg-indigo:hover { background: #3D4A80; box-shadow: 0 4px 16px rgba(74,88,153,.3); }
.bg-amber:hover { background: #A88C10; box-shadow: 0 4px 16px rgba(200,164,21,.3); }
.bg-blue:hover { background: #2E8B57; box-shadow: 0 4px 16px rgba(76,175,80,.3); }
.bg-teal:hover { background: #247563; box-shadow: 0 4px 16px rgba(46,139,122,.3); }
.bg-rose:hover { background: #962D26; box-shadow: 0 4px 16px rgba(184,55,46,.3); }
.tint-green { background: rgba(27,107,58,.08); color: var(--c-green); }
.tint-indigo { background: rgba(74,88,153,.08); color: var(--c-indigo); }
.tint-amber { background: rgba(200,164,21,.08); color: var(--c-amber); }
.tint-blue { background: rgba(76,175,80,.08); color: var(--accent); }
.tint-teal { background: rgba(46,139,122,.08); color: var(--c-teal); }
.tint-rose { background: rgba(184,55,46,.08); color: var(--c-rose); }

/* ===== Footer ===== */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 18px 24px;
  font-size: 0.74rem;
  font-weight: 300;
  margin-top: 40px;
}

/* ===== Animations ===== */
@keyframes up {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.4); }
}

/* ===== Accessibility ===== */
.nav-links a:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Homepage — Hero
   ============================================================ */
.hero { background: var(--bg-gradient); color: #fff; padding: 0; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(76,175,80,.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(232,200,64,.07) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(74,88,153,.05) 0%, transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76,175,80,.4), transparent);
}
.hero-inner {
  max-width: 1200px; margin: 0 auto; padding: 48px 24px 64px;
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.hero-text { z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(76,175,80,.15); border: 1px solid rgba(76,175,80,.25);
  border-radius: var(--radius-full); padding: 5px 14px;
  font-size: .72rem; font-weight: 600; color: var(--accent-hover);
  margin-bottom: 16px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero-badge .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2s ease infinite;
}
.hero h1 { font-size: 2.2rem; font-weight: 700; line-height: 1.4; margin-bottom: 12px; }
.hero h1 span { color: var(--accent-hover); }
.hero-desc { font-size: .92rem; opacity: .7; line-height: 1.8; margin-bottom: 24px; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-actions .btn { padding: 12px 24px; font-size: .86rem; }

/* Homepage — Search */
.search-wrap { max-width: 520px; position: relative; }
.search-wrap input {
  width: 100%; padding: 14px 46px 14px 18px; border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; font-family: inherit; font-size: .86rem; outline: none; transition: all .3s;
}
.search-wrap input::placeholder { color: rgba(255,255,255,.35); }
.search-wrap input:focus {
  border-color: var(--accent); background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-icon {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.35); pointer-events: none; display: flex;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0,0,0,.2); border: 1px solid var(--border);
  max-height: 380px; overflow-y: auto; display: none; z-index: 200; direction: rtl;
}
.search-results.visible { display: block; }
.search-results-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: .84rem; }
.sr-item {
  padding: 10px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  transition: background .15s; text-decoration: none; color: var(--text);
}
.sr-item:hover { background: var(--surface-alt); }
.sr-item:last-child { border-bottom: none; }
.sr-badge { padding: 2px 7px; border-radius: 5px; font-size: .65rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.sr-badge.unhcr { background: rgba(27,107,58,.1); color: var(--c-green); }
.sr-badge.papers { background: rgba(74,88,153,.1); color: var(--c-indigo); }
.sr-badge.editions { background: rgba(200,164,21,.1); color: var(--c-amber); }
.sr-badge.portal { background: rgba(76,175,80,.1); color: var(--accent); }
.sr-info { flex: 1; min-width: 0; }
.sr-title { font-size: .8rem; font-weight: 600; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { font-size: .68rem; color: var(--text-muted); margin-top: 1px; }
.search-count { padding: 7px 16px; font-size: .7rem; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--surface-alt); }

/* Homepage — Hero Side Stats */
.hero-side { z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.hero-mini-stat {
  background: rgba(255,255,255,.06); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-lg);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  transition: all .3s; opacity: 0; transform: translateX(-20px); animation: slideIn .5s ease forwards;
}
.hero-mini-stat:nth-child(1) { animation-delay: .1s; }
.hero-mini-stat:nth-child(2) { animation-delay: .2s; }
.hero-mini-stat:nth-child(3) { animation-delay: .3s; }
.hero-mini-stat:nth-child(4) { animation-delay: .4s; }
.hero-mini-stat:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }
.hms-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; flex-shrink: 0; color: #fff;
}
.hms-icon.i-green { background: rgba(27,107,58,.2); }
.hms-icon.i-indigo { background: rgba(74,88,153,.2); }
.hms-icon.i-amber { background: rgba(200,164,21,.2); }
.hms-icon.i-teal { background: rgba(46,139,122,.2); }
.hms-info { flex: 1; min-width: 0; }
.hms-num { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hms-label { font-size: .72rem; opacity: .6; font-weight: 400; margin-top: 2px; }
.hms-link { font-size: .68rem; color: var(--accent-hover); text-decoration: none; opacity: .8; }
.hms-link:hover { opacity: 1; text-decoration: underline; }

/* Homepage — Stats Strip */
.stats-strip {
  display: flex; gap: 0; margin: -28px auto 0; position: relative; z-index: 10;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden;
}
.ss-item {
  flex: 1; padding: 18px 14px; text-align: center;
  border-left: 1px solid var(--border-light); transition: background .2s; position: relative;
}
.ss-item:last-child { border-left: none; }
.ss-item:hover { background: var(--surface-alt); }
.ss-item::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; opacity: 0; transition: opacity .2s; }
.ss-item:hover::before { opacity: 1; }
.ss-item:nth-child(1)::before { background: var(--c-green); }
.ss-item:nth-child(2)::before { background: var(--c-indigo); }
.ss-item:nth-child(3)::before { background: var(--c-amber); }
.ss-item:nth-child(4)::before { background: var(--c-teal); }
.ss-item:nth-child(5)::before { background: var(--c-rose); }
.ss-item:nth-child(6)::before { background: var(--accent); }
.ss-num { font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.ss-label { font-size: .68rem; color: var(--text-muted); font-weight: 500; }

/* Homepage — Featured */
.featured { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 8px; }
.feat-card {
  background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
  overflow: hidden; display: flex; flex-direction: column; transition: all .3s;
  opacity: 0; transform: translateY(20px); animation: up .6s ease forwards;
}
.feat-card:nth-child(1) { animation-delay: .1s; }
.feat-card:nth-child(2) { animation-delay: .2s; }
.feat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.feat-accent { height: 4px; }
.feat-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.feat-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: .68rem; font-weight: 600;
  width: fit-content; margin-bottom: 10px;
}
.feat-title {
  font-size: 1rem; font-weight: 700; line-height: 1.6; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feat-excerpt {
  font-size: .78rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.feat-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feat-date { font-size: .7rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.feat-link { font-size: .78rem; font-weight: 600; color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 4px; }
.feat-link:hover { text-decoration: underline; }

/* Homepage — Quick Grid */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.qcard {
  background: var(--surface); border-radius: var(--radius-lg); padding: 22px 20px;
  border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: all .25s; display: flex; gap: 14px; align-items: flex-start;
  opacity: 0; transform: translateY(16px); animation: up .5s ease forwards;
  position: relative; overflow: hidden;
}
.qcard::before { content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%; opacity: 0; transition: opacity .2s; }
.qcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.qcard:hover::before { opacity: 1; }
.qcard:nth-child(1) { animation-delay: .05s; } .qcard:nth-child(1)::before { background: var(--c-green); }
.qcard:nth-child(2) { animation-delay: .08s; } .qcard:nth-child(2)::before { background: var(--c-teal); }
.qcard:nth-child(3) { animation-delay: .11s; } .qcard:nth-child(3)::before { background: var(--c-rose); }
.qcard:nth-child(4) { animation-delay: .14s; } .qcard:nth-child(4)::before { background: var(--c-indigo); }
.qcard:nth-child(5) { animation-delay: .17s; } .qcard:nth-child(5)::before { background: var(--accent); }
.qcard:nth-child(6) { animation-delay: .20s; } .qcard:nth-child(6)::before { background: var(--c-amber); }
.qcard:nth-child(7) { animation-delay: .23s; } .qcard:nth-child(7)::before { background: var(--c-green); }
.qcard:nth-child(8) { animation-delay: .26s; } .qcard:nth-child(8)::before { background: var(--c-sky); }
.qcard:nth-child(9) { animation-delay: .29s; } .qcard:nth-child(9)::before { background: var(--c-indigo); }
.qc-icon-wrap {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; flex-shrink: 0;
}
.qc-content { flex: 1; min-width: 0; }
.qc-title { font-size: .9rem; font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.qc-desc { font-size: .74rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 6px; }
.qc-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.qc-tag {
  font-size: .65rem; padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border-light); font-weight: 500;
}
.qc-arrow { font-size: .72rem; color: var(--accent); font-weight: 600; margin-top: 4px; flex-shrink: 0; align-self: center; }

/* Homepage — Coverage */
.coverage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 8px; }
.cov-card {
  background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 22px 20px; opacity: 0; transform: translateY(20px); animation: up .5s ease forwards;
}
.cov-card:nth-child(1) { animation-delay: .1s; }
.cov-card:nth-child(2) { animation-delay: .2s; }
.cov-title { font-size: .92rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.cov-bars { display: flex; flex-direction: column; gap: 10px; }
.cov-row { display: flex; align-items: center; gap: 10px; }
.cov-label { font-size: .76rem; color: var(--text-muted); width: 90px; flex-shrink: 0; text-align: left; }
.cov-bar { flex: 1; height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.cov-fill { height: 100%; border-radius: 4px; transition: width 1s ease .3s; }
.cov-val { font-size: .72rem; font-weight: 700; width: 28px; text-align: center; flex-shrink: 0; }
.loc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.loc-chip {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  background: var(--surface-alt); border: 1px solid var(--border-light);
  border-radius: var(--radius); font-size: .76rem; transition: all .2s;
}
.loc-chip:hover { border-color: var(--accent); background: rgba(76,175,80,.04); }
.loc-chip .lc-name { font-weight: 600; color: var(--text); }
.loc-chip .lc-count { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Homepage — Source Cards */
.source-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.source-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column;
  transition: all .3s; opacity: 0; transform: translateY(20px); animation: up .6s ease forwards;
}
.source-card:nth-child(1) { animation-delay: .1s; }
.source-card:nth-child(2) { animation-delay: .18s; }
.source-card:nth-child(3) { animation-delay: .26s; }
.source-card:nth-child(4) { animation-delay: .34s; }
.source-card:nth-child(5) { animation-delay: .42s; }
.source-card:nth-child(6) { animation-delay: .50s; }
.source-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.1); border-color: transparent; }
.sc-accent { height: 4px; width: 100%; }
.sc-body { padding: 22px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.sc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sc-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 11px; flex-shrink: 0; }
.sc-title { font-size: 1.05rem; font-weight: 700; }
.sc-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; }
.sc-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sc-stat {
  background: var(--surface-alt); border: 1px solid var(--border-light); border-radius: 7px;
  padding: 5px 10px; font-size: .7rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px;
}
.sc-stat strong { color: var(--text); font-weight: 700; font-size: .8rem; }
.sc-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: var(--radius-full); font-size: .68rem; font-weight: 600; margin-bottom: 14px; width: fit-content;
}
.sc-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px;
  border-radius: var(--radius-full); font-family: inherit; font-size: .8rem; font-weight: 600;
  text-decoration: none; color: #fff; transition: all .25s; margin-top: auto; width: fit-content;
  border: none; cursor: pointer;
}

/* Homepage — Recent Tabs */
.recent-section { margin-bottom: 44px; }
.recent-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 0; }
.recent-tab {
  padding: 10px 20px; font-size: .82rem; font-weight: 600; cursor: pointer;
  border: none; background: none; color: var(--text-muted);
  border-bottom: 2.5px solid transparent; margin-bottom: -2px; transition: all .2s;
  font-family: inherit; display: flex; align-items: center; gap: 6px;
}
.recent-tab:hover { color: var(--text); background: var(--surface-alt); }
.recent-tab.active { color: var(--text); border-bottom-color: var(--accent); background: var(--surface); }
.recent-tab .tab-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.recent-panel {
  display: none; background: var(--surface); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.recent-panel.active { display: block; }
.recent-list { list-style: none; }
.recent-list li {
  padding: 12px 20px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: flex-start; gap: 12px; transition: background .15s;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list li:hover { background: var(--surface-alt); }
.rl-num {
  font-size: .68rem; font-weight: 700; color: var(--text-muted);
  background: var(--surface-alt); border-radius: 6px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.rl-body { flex: 1; min-width: 0; }
.rl-title { font-size: .82rem; font-weight: 600; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-title a { text-decoration: none; color: var(--text); transition: color .15s; }
.rl-title a:hover { color: var(--accent); }
.rl-meta { font-size: .7rem; color: var(--text-muted); margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.recent-list .empty-msg { color: var(--text-muted); font-size: .84rem; padding: 24px; text-align: center; }

/* Homepage — Info Banner */
.info-banner {
  background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 24px; display: flex; gap: 20px; align-items: center; margin-bottom: 8px;
  opacity: 0; transform: translateY(20px); animation: up .6s .1s ease forwards;
}
.info-banner-icon {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: rgba(76,175,80,.08); border-radius: 14px; flex-shrink: 0; color: var(--accent);
}
.info-banner-text { flex: 1; }
.info-banner-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.info-banner-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.6; }
.info-banner-btn { flex-shrink: 0; }

/* ============================================================
   Responsive — Global
   ============================================================ */
@media (max-width: 768px) {
  .nav-brand { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; width: 100%; flex-direction: column;
    background: var(--primary-light); position: absolute; top: 100%; left: 0; right: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 999; max-height: 70vh; overflow-y: auto;
  }
  .nav-inner.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.84rem; }
  .nav-links a.active { border-bottom-color: rgba(255,255,255,0.05); border-right: 3px solid var(--accent); }
  .page-title-bar { padding: 16px; }
  .page-title-bar h1 { font-size: 1.1rem; }
  .page-content { padding: 16px 12px 30px; }
  .stats-bar { padding: 10px 14px; gap: 16px; }
  .filters-bar { padding: 10px 14px; }
}
@media (max-width: 480px) {
  .nav-links a { padding: 10px 16px; font-size: 0.8rem; }
  .page-title-bar .actions { width: 100%; }
  .btn { padding: 7px 14px; font-size: 0.76rem; }
}

/* ============================================================
   Shared — Page Hero (unified sub-page header)
   ============================================================ */
.page-hero {
  background: var(--bg-gradient); color: #fff; padding: 28px 24px 22px;
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(76,175,80,.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(232,200,64,.06) 0%, transparent 45%);
  pointer-events: none;
}
.page-hero-inner {
  max-width: 1400px; margin: 0 auto; position: relative;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.page-hero h1 {
  font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 10px;
}
.page-hero .hero-sub {
  font-size: .82rem; opacity: .65; font-weight: 400; margin-top: 6px; max-width: 700px; line-height: 1.7;
}
.page-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Shared — Overview Dashboard (data page summaries)
   ============================================================ */
.overview-dashboard {
  background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 24px; margin: 0 20px; box-shadow: var(--shadow-sm); position: relative; top: -16px; z-index: 5;
}
.overview-desc {
  font-size: .86rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 20px; max-width: 820px;
}
.overview-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.overview-stat {
  flex: 1; min-width: 130px; background: var(--surface-alt); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px; text-align: center; transition: transform .2s, box-shadow .2s;
}
.overview-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ov-num {
  font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-bottom: 4px;
}
.ov-label { font-size: .7rem; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   Shared — CSS Bar Charts
   ============================================================ */
.css-chart { margin-bottom: 16px; }
.css-chart-title {
  font-size: .82rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.chart-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.chart-label {
  font-size: .73rem; color: var(--text-muted); width: 100px; flex-shrink: 0; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-bar-bg { flex: 1; height: 10px; background: var(--border-light); border-radius: 5px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 5px; transition: width .8s ease; min-width: 2px; }
.chart-val {
  font-size: .7rem; font-weight: 700; width: 32px; text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums;
}

/* ============================================================
   Shared — Responsive for new classes
   ============================================================ */
@media (max-width: 768px) {
  .page-hero { padding: 20px 16px 16px; }
  .page-hero h1 { font-size: 1.1rem; }
  .page-hero .hero-sub { font-size: .76rem; }
  .overview-dashboard { margin: 0 12px; padding: 16px; top: -10px; }
  .overview-stats { gap: 8px; }
  .overview-stat { min-width: 100px; padding: 12px; }
  .ov-num { font-size: 1.2rem; }
  .chart-cols { grid-template-columns: 1fr; }
  .chart-label { width: 80px; font-size: .68rem; }
}

/* ============================================================
   Responsive — Homepage
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .search-wrap { margin: 0 auto; }
  .hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-strip { flex-wrap: wrap; }
  .ss-item { min-width: calc(33.3% - 1px); flex: none; }
  .featured { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .coverage-grid { grid-template-columns: 1fr; }
  .source-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .hero-inner { padding: 28px 16px 44px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .hero-mini-stat { padding: 12px 14px; }
  .hms-num { font-size: 1.1rem; }
  .stats-strip { flex-wrap: wrap; margin-top: -20px; }
  .ss-item { min-width: calc(33.3% - 1px); }
  .container { padding: 0 12px; }
  .quick-grid { grid-template-columns: 1fr; }
  .source-cards { grid-template-columns: 1fr; }
  .recent-tabs { overflow-x: auto; scrollbar-width: none; }
  .recent-tabs::-webkit-scrollbar { display: none; }
  .recent-tab { padding: 8px 14px; font-size: .76rem; white-space: nowrap; }
  .info-banner { flex-direction: column; text-align: center; }
  .loc-chips { justify-content: center; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.3rem; }
  .hero-side { grid-template-columns: 1fr; }
  .stats-strip { flex-wrap: wrap; }
  .ss-item { min-width: calc(50% - 1px); }
  .ss-num { font-size: 1.2rem; }
  .qcard { flex-direction: column; gap: 10px; padding: 16px; }
  .qc-arrow { align-self: flex-start; }
  .hero-actions .btn { padding: 10px 18px; font-size: .8rem; }
}
