/* ==========================================================================
   Agromatik-teema — johdettu GPS-tracker-sivusta (/gps/).
   Jaettu "farmi-tech HUD" -malli koko alustalle: musta + teal, grid-tausta,
   Barlow Condensed + Share Tech Mono. Linkitä <head>:iin sivuilla:
     <link rel="stylesheet" href="/assets/agromatik-theme.css">
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Barlow+Condensed:wght@300;400;600;700&display=swap');

:root{
  --ag-bg:#0a0a0a; --ag-panel:#111318; --ag-panel2:#141821; --ag-border:#1e2530;
  --ag-accent:#00e5a0; --ag-accent2:#0066ff; --ag-warn:#ff4444; --ag-danger:#ff5c5c;
  --ag-text:#e8eaf0; --ag-muted:#7a8798; --ag-ink:#001912;
  --ag-mono:'Share Tech Mono',ui-monospace,monospace;
  --ag-sans:'Barlow Condensed',system-ui,-apple-system,'Segoe UI',sans-serif;
}

/* Hienovarainen tekninen grid-tausta (kuten trackerissa) */
body::before{
  content:''; position:fixed; inset:0; z-index:0; pointer-events:none; opacity:.20;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, #161b24 39px, #161b24 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, #161b24 39px, #161b24 40px);
}
/* Nosta sisältörakenteet gridin päälle (grid on z-index:0) ilman että rikotaan
   absoluuttisia overlay-elementtejä (joilla on oma korkeampi z-index). */
header, main, .container, .sheet, #map, .modal, .cards, .wrap{ position:relative; z-index:1; }

/* Perusfontti kaikille sivuille jotka EIVÄT määritä omaa body-fonttia
   (esim. gps2/gps3). Sivun oma inline-body-fontti voittaa tämän järjestyksen vuoksi. */
body{ font-family:var(--ag-sans); }

/* Valikoitu tyylitys otsikkobrändille (jos sivu käyttää .brand) */
.brand{ font-family:var(--ag-sans); letter-spacing:.4px; }

/* ---- Leaflet: kontrollit, PIIRTOTYÖKALUT ja popupit tumma-teemaan ---- */
.leaflet-bar, .leaflet-bar a,
.leaflet-control-layers,
.leaflet-draw-toolbar a{
  background-color:var(--ag-panel) !important;
  color:var(--ag-text) !important;
  border-color:var(--ag-border) !important;
}
.leaflet-bar a{ border-bottom:1px solid var(--ag-border) !important; }
.leaflet-bar a:hover,
.leaflet-draw-toolbar a:hover{ background-color:var(--ag-panel2) !important; }
.leaflet-bar a.leaflet-disabled{ background-color:#0d0f13 !important; color:#3a4250 !important; }
/* Leaflet.draw -ikonit ovat tummia spritejä → käännä vaaleiksi tummalla napilla */
.leaflet-draw-toolbar a{ filter:invert(0.9) hue-rotate(180deg) brightness(1.05); }
.leaflet-draw-actions a{ background:var(--ag-panel) !important; color:var(--ag-text) !important; border-color:var(--ag-border) !important; }
.leaflet-draw-actions a:hover{ background:var(--ag-panel2) !important; }
.leaflet-control-layers-expanded{ padding:8px 10px !important; color:var(--ag-text) !important; }
.leaflet-control-layers label{ color:var(--ag-text) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip{
  background:var(--ag-panel) !important; color:var(--ag-text) !important; border:1px solid var(--ag-border);
}
.leaflet-container a.leaflet-popup-close-button{ color:var(--ag-muted) !important; }
.leaflet-container{ background:#0a141f; }
.leaflet-control-attribution{ background:rgba(10,10,10,.72) !important; }
.leaflet-control-attribution, .leaflet-control-attribution a{ color:var(--ag-muted) !important; }
.leaflet-tooltip.area-label{ background:transparent !important; border:none !important; box-shadow:none !important; }
