@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

/* ── Light mode tokens ── */
:root {
  --primary:        #005e26;
  --primary-hover:  #004a1e;
  --primary-dim:    #005e26;

  --bg:             #f9f9fc;
  --bg-surface:     #ffffff;
  --bg-low:         #f3f3f6;
  --bg-container:   #eeeef0;
  --bg-white:       #ffffff;

  --text:           #1a1c1e;
  --text-sec:       #3f4a3e;
  --text-muted:     #6f7a6d;
  --border:         #e2e2e6;
  --border-strong:  #becabb;

  --max-w:          1280px;
  --px:             64px;
  --px-mob:         20px;

  --font-head:      'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body:      'Inter', 'Plus Jakarta Sans', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      12px;
  --radius-xl:      16px;
  --radius-full:    9999px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.1);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.14);
}

/* ── Dark mode tokens ── */
html.dark {
  --primary:        #005e26;
  --primary-hover:  #00471d;
  --primary-dim:    #4fd620;

  --bg:             #0D0D0D;
  --bg-surface:     #161616;
  --bg-low:         #1A1A1A;
  --bg-container:   #1E1E1E;
  --bg-white:       #1E1E1E;

  --text:           #FFFFFF;
  --text-sec:       #CCCCCC;
  --text-muted:     #888888;
  --border:         #2A2A2A;
  --border-strong:  #3A3A3A;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
body  {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); }
img  { max-width: 100%; height: auto; display: block; }
a    { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
ul,ol { list-style: none; }

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}
@media (max-width: 768px) { .container { padding: 0 var(--px-mob); } }
.section-pad { padding: 64px 0; }
.section-pad-sm { padding: 40px 0; }

/* ── Material Icons ── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 28px; border-radius: var(--radius-full);
  font-family: var(--font-head); font-size: 14px; font-weight: 700;
  transition: all .18s ease; cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: #fff; border: 2px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--primary); border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  padding: 9px 20px;
}
.btn-ghost:hover { background: var(--bg-container); color: var(--text); }
.btn-sm { padding: 7px 18px; font-size: 13px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }

/* ── Cards ── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.card-sm { padding: 18px; border-radius: var(--radius-lg); }

/* ── Badge ── */
.badge {
  display: inline-block; padding: 3px 12px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 700;
  font-family: var(--font-mono); letter-spacing: .05em;
}
.badge-green  { background: rgba(0,94,38,.1);  color: var(--primary); }
.badge-gray   { background: var(--bg-container); color: var(--text-muted); }

/* ── Sub-nav ── */
.sub-nav {
  display: flex; gap: 2px; flex-wrap: wrap;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--px);
}
@media (max-width: 768px) { .sub-nav { padding: 0 var(--px-mob); } }
.sub-nav a {
  padding: 13px 16px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.sub-nav a:hover  { color: var(--primary); }
.sub-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); padding: 14px 0;
  font-family: var(--font-mono);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { opacity: .4; }

/* ── Form ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-sec); }
.form-label .req { color: #ba1a1a; margin-left: 3px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px;
  background: var(--bg-surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-family: var(--font-body); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,94,38,.1);
}
html.dark .form-input:focus, html.dark .form-select:focus {
  box-shadow: 0 0 0 3px rgba(60,185,23,.15);
}
.form-input.error { border-color: #ba1a1a; }
.form-error { font-size: 12px; color: #ba1a1a; font-weight: 600; display: none; }
.form-error.visible { display: block; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th {
  background: var(--bg-low); padding: 12px 18px;
  text-align: left; font-size: 12px; font-weight: 700;
  font-family: var(--font-mono); letter-spacing: .04em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
td { padding: 13px 18px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-low); }

/* ── Dialog / Modal ── */
dialog {
  background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 0; max-width: 600px; width: 92%;
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(0,0,0,.48); backdrop-filter: blur(5px); }
.modal-header {
  padding: 24px 28px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-body   { padding: 24px 28px; }
.modal-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--bg-container); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); flex-shrink: 0;
  transition: background .15s;
}
.modal-close:hover { background: var(--bg-low); }

/* ── Alert ── */
.alert { padding: 14px 18px; border-radius: var(--radius-md); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(0,94,38,.08); color: var(--primary); border: 1px solid rgba(0,94,38,.2); }
.alert-error   { background: rgba(186,26,26,.08); color: #ba1a1a;        border: 1px solid rgba(186,26,26,.2); }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
@media (max-width:1024px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .grid-4,.grid-3,.grid-2 { grid-template-columns: 1fr; } }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(18px); }
  to   { opacity:1; transform:translateY(0); }
}
.animate-in { animation: fadeInUp .45s ease both; }
.animate-d1 { animation-delay: .08s; }
.animate-d2 { animation-delay: .16s; }
.animate-d3 { animation-delay: .24s; }

/* ── Page hero ── */
.page-tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 10px;
}
.page-title { font-size: clamp(26px,4vw,42px); font-weight: 800; line-height: 1.15; font-family: var(--font-head); }
.page-desc  { font-size: 16px; color: var(--text-muted); margin-top: 10px; max-width: 540px; line-height: 1.7; }

/* ── Stat card ── */
.stat-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; text-align: center; }
.stat-num   { font-size: 40px; font-weight: 800; color: var(--primary); line-height: 1; font-family: var(--font-head); }
.stat-lbl   { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ── Marquee ── */
.marquee-wrap { overflow: hidden; }
.marquee-track {
  display: flex; align-items: center; gap: 56px;
  width: max-content;
  animation: marqueeScroll 28s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-item {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; color: var(--text-muted);
  white-space: nowrap; transition: color .15s;
}
.marquee-item:hover { color: var(--primary); }
