:root {
  --green: #1b4332; --green-light: #2d6a4f; --accent: #e0532f; --bg: #f4f6f4; --text: #1c1c1c;
  --muted: #5f6b63; --border: #d5ddd7; --error: #b42318; --online: #2fa84f; --offline: #b9c2bc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--green-light); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; }
.narrow { max-width: 420px; margin: 80px auto; }
header.bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { margin: 0; font-size: 26px; color: var(--green); }
h2 { font-size: 18px; margin: 28px 0 10px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.stats { display: flex; gap: 18px; font-size: 14px; color: var(--muted); }
.stats b { color: var(--text); }
button, .btn { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
button.danger { color: var(--error); }
button.link { border: 0; background: none; color: var(--green-light); text-decoration: underline; padding: 0; }
input[type="text"], input[type="password"] { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; width: 100%; }
form.inline { display: flex; gap: 8px; align-items: center; }
form.inline input { width: auto; flex: 1; }
.error { color: var(--error); }
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #fafbfa; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; }
td.actions > * + * { margin-left: 6px; }
.table-scroll { overflow-x: auto; }

.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--offline); }
.dot.online { background: var(--online); box-shadow: 0 0 0 3px rgba(47,168,79,.2); }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: zoom-in; background: #e6ebe7; }
.thumbs img.nogps { outline: 2px dashed var(--offline); outline-offset: -2px; }
.more { margin-top: 6px; }
.banner { background: #fff3cd; border: 1px solid #ffe08a; color: #6b4e00; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }

#map { height: 60vh; min-height: 360px; border: 1px solid var(--border); border-radius: 12px; margin-top: 12px; }
.leaflet-popup-content img { width: 160px; height: 120px; object-fit: cover; border-radius: 6px; display: block; cursor: zoom-in; }
.leaflet-popup-content .caption { margin-top: 6px; font-size: 13px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox .caption { color: #fff; margin-top: 12px; font-size: 14px; text-align: center; max-width: 800px; }
.lightbox .caption .muted { color: #c5cfc8; }
.lightbox button { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 20px; width: 40px; height: 40px; border-radius: 50%; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 28px; width: 48px; height: 48px; }
.lightbox .prev { left: 16px; right: auto; }
.lightbox .next { right: 16px; }

.qr { text-align: center; }
.qr img { width: min(80vw, 600px); height: auto; }
.qr .url { font-family: ui-monospace, monospace; font-size: 18px; word-break: break-all; }
@media print { .no-print { display: none !important; } body { background: #fff; } }
