/* Forestr dashboard: forest green, olive, charcoal and off-white, as in the app. */
:root {
  --green: #2f5d3a; --green-dark: #22452b; --olive: #7a7d3a; --charcoal: #1f2321; --paper: #f6f4ec;
  --card: #ffffff; --line: #dcd9cc; --muted: #5f645f; --error: #b3261e; --amber: #f9a825; --live: #2e7d32;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--charcoal); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--green); }
.top { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; background: var(--green); color: var(--paper); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--paper); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
#crumbs { flex: 1; display: flex; gap: .4rem; flex-wrap: wrap; }
#crumbs a, #crumbs span { color: var(--paper); opacity: .9; }
#account { display: flex; gap: .6rem; align-items: center; font-size: .9rem; }
#account button { background: transparent; color: var(--paper); border-color: rgba(246,244,236,.6); }
main { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; color: var(--green-dark); }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--error); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.cards .card { margin: 0; }
.cards a.card { text-decoration: none; color: inherit; display: block; }
.cards a.card:hover { border-color: var(--green); }
button, .button { font: inherit; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--green); background: var(--green); color: var(--paper); cursor: pointer; min-height: 40px; text-decoration: none; display: inline-flex; align-items: center; }
button.secondary, .button.secondary { background: var(--card); color: var(--green); }
button.danger { background: var(--card); color: var(--error); border-color: var(--error); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-height: 40px; max-width: 100%; }
textarea { min-height: 70px; width: 100%; }
label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem 1rem; align-items: end; }
.form .wide { grid-column: 1 / -1; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: .2rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { color: var(--green-dark); border-bottom-color: var(--green); font-weight: 600; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
th { background: #eeece2; font-weight: 600; position: sticky; top: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f3f1e8; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
.chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; background: #eeece2; white-space: nowrap; }
.chip.green { background: #dcefdc; color: #1b5e20; } .chip.amber { background: #fff3cd; color: #7a5a00; }
.chip.grey { background: #e7e7e7; color: #424242; } .chip.red { background: #fde0dc; color: var(--error); } .chip.blue { background: #dde8f7; color: #0d47a1; }
.bar { height: 8px; background: #e6e3d6; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--green); }
.map { height: 560px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.map.small { height: 280px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1rem; }
.layers label { flex-direction: row; align-items: center; gap: .4rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.banner { padding: .6rem .9rem; border-radius: 8px; background: #fde0dc; color: var(--error); margin-bottom: .8rem; }
.notice { padding: .6rem .9rem; border-radius: 8px; background: #eef3e6; margin-bottom: .8rem; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; letter-spacing: .08em; }
.history li { margin-bottom: .35rem; }
#toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--charcoal); color: var(--paper); padding: .7rem 1.1rem; border-radius: 8px; max-width: 90vw; z-index: 10; }
.login { max-width: 400px; margin: 3rem auto; }
.login form { display: flex; flex-direction: column; gap: .8rem; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; max-width: min(640px, 94vw); }
dialog::backdrop { background: rgba(31,35,33,.4); }
.maplibregl-popup-content { font-size: .85rem; max-width: 320px; }
.popup-table td { padding: .15rem .4rem; border: 0; font-size: .82rem; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .map { height: 420px; } }
