/*
 * WV Planting Tool: shared dark theme.
 * Cool dark neutral surfaces, one sage-green accent, IBM Plex type.
 * Every page links this file first (from layout.html); page CSS uses only these tokens.
 */
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #11161c;
  --surface: #182029;
  --surface-2: #212b36;
  --text: #e6ebf0;
  --muted: #8d99a6;
  --border: #283340;
  --border-strong: #384656;
  --accent: #7cc49a;          /* sage green: links, active states, primary actions */
  --accent-contrast: #0b1410;
  --accent-2: #8fb3c9;
  --ok: #6dbb8b;
  --warn: #d3a04c;
  --danger: #e0685f;
  --radius: 8px; --radius-sm: 5px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 28px rgba(0, 0, 0, 0.45);
  --nav-h: 60px;
  --font-display: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: var(--bg); font: 400 15px/1.55 var(--font-body); color: var(--text); -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 0.4em; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0 0 0.8em; }
img { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------- Top navigation (layout.html) ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100000;
  display: flex; align-items: center; gap: 4px;
  height: var(--nav-h); padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 92%, #000);
  border-bottom: 1px solid var(--border);
}
.navbar .brand {
  display: flex; align-items: center; gap: 10px; margin-right: 18px;
  font: 700 0.98rem/1 var(--font-display); color: var(--text); letter-spacing: 0.01em; white-space: nowrap;
}
.navbar .brand svg { color: var(--accent); flex: none; }
.navbar .link {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.navbar .link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.navbar .link.active { color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); }
#deplogo {
  margin-left: auto; width: 40px; height: 40px; object-fit: contain;
  background: #fff; border-radius: 50%; padding: 3px;
}
@media (max-width: 640px) {
  .navbar { padding: 0 10px; }
  .navbar .brand span { display: none; }
  .navbar .brand { margin-right: 6px; }
  .navbar .link { padding: 8px 8px; font-size: 0.85rem; }
}

/* ---------- Controls ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.9rem/1 var(--font-body); color: var(--accent-contrast); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 16px; cursor: pointer;
  transition: background-color 120ms ease, transform 80ms ease;
}
button:hover, .btn:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
button:active, .btn:active { transform: translateY(1px); }
.btn-secondary { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.btn-secondary:hover { background: color-mix(in srgb, var(--surface-2) 80%, #fff); }
button:disabled { opacity: 0.45; cursor: default; }

input, select, textarea {
  font: 400 0.92rem/1.4 var(--font-body); color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238d99a6' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type="radio"] { accent-color: var(--accent); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; padding: 10px 12px;
  font: 600 0.7rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:not(:has(td)) { display: none; } /* hides empty rows left by unclosed <tr> tags */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

@media print {
  html, body { background: #fff; color: #000; }
  .navbar, button, .btn, .no-print { display: none !important; }
  table { background: #fff; }
  th { position: static; color: #000; background: #eee; }
  td { border-color: #bbb; }
  a { color: #000; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
