/* ═══════════════════════════════════════════════════
   1. CORE VARIABLES & THEMES
═══════════════════════════════════════════════════ */
:root {
  --bg:        #f7f6f3;
  --bg2:       #eeece8;
  --surface:   #ffffff;
  --border:    #dedad4;
  --border-s:  #e8e5e0;
  --text:      #17202e;
  --text2:     #3a4456;
  --text3:     #7a8499;
  --navy:      #1a3666;
  --navy2:     #1e4080;
  --accent:    #e63946;
  --radius:    12px;
  --radius-sm: 8px;
  --content-w: 860px;
  --page-w:    1200px;
  --header-h:  64px;
}

[data-theme="dark"] {
  --bg:        #0f141e;
  --bg2:       #151c28;
  --surface:   #1a2332;
  --border:    #2d3a4f;
  --border-s:  #222d40;
  --text:      #e8e5e0;
  --text2:     #b0b8c6;
  --text3:     #7a8499;
  --navy:      #8ab4f8;
  --navy2:     #a8c7fa;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg:        #0f141e;
    --bg2:       #151c28;
    --surface:   #1a2332;
    --border:    #2d3a4f;
    --border-s:  #222d40;
    --text:      #e8e5e0;
    --text2:     #b0b8c6;
    --text3:     #7a8499;
    --navy:      #8ab4f8;
    --navy2:     #a8c7fa;
  }
}

/* ═══════════════════════════════════════════════════
   2. RESET & BASE
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Source Serif 4', Georgia, serif;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
  min-height: 90vh;
}
a { color: var(--navy); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--navy2); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
button { font-family: 'DM Sans', sans-serif; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4 { font-family: 'DM Serif Display', serif; font-weight: 400; line-height: 1.2; color: var(--text); margin-bottom: 0.75rem; }
.ui-text { font-family: 'DM Sans', sans-serif; }

/* ═══════════════════════════════════════════════════
   3. SITE HEADER & MOBILE MENU
═══════════════════════════════════════════════════ */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
}
.header-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--text);
  z-index: 1001;
}
.logo:hover { text-decoration: none; color: var(--navy); }

.nav-desktop { display: flex; gap: 1.5rem; align-items: center; }
.nav-desktop a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text2);
  font-weight: 500;
}
.nav-desktop a:hover { color: var(--navy); text-decoration: none; }
.nav-desktop a[aria-current="page"] { color: var(--navy); }

/* Theme toggle button */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.theme-btn:hover { background: var(--border); color: var(--text); }
.theme-btn svg { width: 16px; height: 16px; }

/* Show/hide icons based on current theme */
.icon-auto, .icon-light, .icon-dark { display: none; }
[data-theme="auto"]  .icon-auto  { display: block; }
[data-theme="light"] .icon-light { display: block; }
[data-theme="dark"]  .icon-dark  { display: block; }

/* Mobile menu */
.menu-toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; z-index: 1001; }
.hamburger { width: 22px; height: 2px; background: var(--text); position: relative; transition: 0.3s; }
.hamburger::before, .hamburger::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}
.hamburger::before { top: -7px; }
.hamburger::after { bottom: -7px; }
.menu-open .hamburger { background: transparent; }
.menu-open .hamburger::before { transform: rotate(45deg); top: 0; }
.menu-open .hamburger::after { transform: rotate(-45deg); bottom: 0; }

.mobile-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: var(--surface);
  z-index: 1000;
  padding: 80px 2rem 2rem;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.menu-open .mobile-overlay { right: 0; }
.mobile-overlay a {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .menu-toggle { display: flex; }
}

/* ═══════════════════════════════════════════════════
   4. PAGE LAYOUT
═══════════════════════════════════════════════════ */
.page_wrap {
  flex: 1;
  width: 100%;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content_wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(90vh - var(--header-h));
}

.main {
  flex: 1;
  padding: 2.5rem 0;
}

.content_footer {
  padding: 2rem 0;
}

/* ═══════════════════════════════════════════════════
   5. HOME — STATS BAR
═══════════════════════════════════════════════════ */
.home_stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.home_stats_item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.home_stats_item h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 0.1rem;
}
.home_stats_item p {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}

/* ═══════════════════════════════════════════════════
   6. CONTENT PAGE HEADER (inside main, not the nav)
═══════════════════════════════════════════════════ */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-s);
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

/* ═══════════════════════════════════════════════════
   7. TABLE / DATA GRID
═══════════════════════════════════════════════════ */
.container-table100 {
  width: 100%;
}
.wrap-table100 {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.table100 {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
.table100 th,
.table100 td {
  padding: 0.85rem 1.2rem;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-s);
  color: var(--text2);
}
.table100 th {
  background: var(--bg2);
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}
.table100 tr:last-child td { border-bottom: none; }
.table100 tr:hover td { background: var(--bg2); }

/* ═══════════════════════════════════════════════════
   8. SHARED UI ELEMENTS
═══════════════════════════════════════════════════ */
.container { max-width: var(--page-w); margin: 0 auto; padding: 2rem 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  transition: 0.2s;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn:hover { background: var(--navy2); transform: translateY(-1px); color: #fff; text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.3s;
  text-decoration: none !important;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06); }
.card-body { padding: 1.25rem; }
.card-title {
  font-size: 1.25rem;
  font-family: 'DM Serif Display', serif;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════
   9. FOOTER
═══════════════════════════════════════════════════ */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 1.5rem 2.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  text-align: center;
}
.footer-desc {
  font-size: 0.9rem;
  color: var(--text3);
  margin-top: 1rem;
  max-width: 480px;
  margin-inline: auto;
  font-family: 'DM Sans', sans-serif;
}
.footer-links {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}
.footer-link:hover { color: var(--navy); }
.footer-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: 2rem;
}

/* ═══════════════════════════════════════════════════
   10. FOOTER STATS
═══════════════════════════════════════════════════ */
.footer-stats {
  background: var(--bg2);
  border-top: 1px solid var(--border-s);
  padding: 0.6rem 1.5rem;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text3);
}

/* ═══════════════════════════════════════════════════
   11. UTILITY
═══════════════════════════════════════════════════ */
.limiter { width: 100%; }
.text-muted { color: var(--text3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
