:root {
    --green-900: #16352d;
    --green-800: #0f6e56;
    --green-600: #1d9e75;
    --green-100: #e5f4ee;
    --paper: #f7f9f8;
    --ink: #10231f;
    --muted: #60746e;
    --line: #d8e5df;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; }

.map-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar, .admin-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px clamp(16px, 4vw, 36px); background: white; border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 4px; color: var(--green-800); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: 0; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 4vw, 42px); }
.button, button {
    border: 0; border-radius: 8px; background: var(--green-800); color: white;
    padding: 10px 14px; font-weight: 800; text-decoration: none; cursor: pointer;
}
.map-canvas { min-height: 420px; width: 100%; }
.map-canvas.full { height: 100vh; }
.status-panel {
    margin: 0; padding: 14px clamp(16px, 4vw, 36px); background: var(--green-900); color: white;
    font-size: 16px; line-height: 1.5;
}
.status-panel.large { font-size: clamp(20px, 3vw, 32px); }
.tv-mode .map-canvas { min-height: calc(100vh - 170px); }
.embed-mode { overflow: hidden; }
.embed-badge {
    position: fixed; left: 12px; bottom: 12px; z-index: 500; background: rgba(255,255,255,.94);
    border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--green-900); font-weight: 800;
}

.widget-mode { min-height: 100vh; display: grid; place-items: center; padding: 12px; background: transparent; }
.widget-card { width: min(100%, 380px); background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 14px 36px rgba(15,110,86,.14); }
.widget-card header { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; color: white; background: var(--green-800); font-weight: 800; }
.widget-card p { margin: 0; padding: 10px 14px; color: var(--muted); }
.widget-map { height: 260px; }

.admin-shell { width: min(1180px, 100%); margin: 0 auto; padding-bottom: 32px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; padding: 20px; }
.metrics article, .table-wrap { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metrics span { display: block; color: var(--muted); margin-bottom: 8px; }
.metrics strong { font-size: 28px; color: var(--green-800); }
.table-wrap { margin: 0 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--green-900); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 18px 20px; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
input { border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; }
.history-map { height: min(68vh, 680px); min-height: 420px; margin: 0 20px 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

.leaflet-container { font: inherit; }
.gps-marker {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--green-600); color: white; border: 3px solid white; box-shadow: 0 6px 20px rgba(22,53,45,.28);
}

@media (max-width: 640px) {
    .topbar, .admin-nav { align-items: flex-start; flex-direction: column; }
    .map-canvas { min-height: 58vh; }
    .history-map { margin-inline: 12px; }
    .table-wrap { margin-inline: 12px; }
}
