/* =====================================================================
   vandstande.dk – designsystem (samme designsprog som HYBER)
   Skrift: Barlow (brødtekst) + Barlow Semi Condensed (overskrifter, tal)
   Detalje: en målestok (skalapæl) under topbjælken
   ===================================================================== */

:root {
  /* Farver og skrift er de samme som i HYBER (vandstande.dk/hyber) */
  --ink: #15302d;          /* blæk – tekst og topbjælke */
  --ink-soft: #4f6562;
  --muted: #5f7572;
  --paper: #eef3f2;        /* papir – baggrund */
  --surface: #ffffff;      /* flade – paneler */
  --line: #d3dedc;
  --line-soft: #e4ecea;
  --field-line: #b9c9c6;
  --water: #1284ba;        /* vand – links og primære knapper */
  --water-deep: #0b6894;
  --water-tint: #e2f0f7;
  --water-light: #4fb3e3;  /* markering i topbjælken */
  --amber: #a8650d;
  --amber-tint: #fbf0dc;
  --danger: #b3261e;
  --danger-tint: #fbe7e5;
  --ok: #2f7a4d;
  --ok-tint: #e3f3e8;

  /* målestedstyper (samme betydning som farverne på kortet) */
  --t-overflade: #1284ba;
  --t-grundvand: #a0581c;
  --t-nedbor: #2f7a4d;
  --t-jord: #2b2b2b;
  --t-pause: #ffffff;

  --font: "Barlow", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", Roboto, Arial, sans-serif;

  --radius-s: 4px;
  --radius-m: 8px;
  --wrap: 1240px;
  --gutter: clamp(16px, 3vw, 28px);
}

/* ---------- grundlag ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; height: auto; border: 0; }

a { color: var(--water); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--water-deep); text-decoration-thickness: 2px; }
a:visited { color: var(--water); }

:focus-visible { outline: 3px solid var(--water-light); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-cond);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  margin: 1.4em 0 .5em;
}
h1 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -.01em; margin-top: .4em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---------- formularer (gælder også de gamle admin-sider) ---------- */
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=datetime-local], input[type=tel], input:not([type]),
select, textarea {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-s);
  padding: 6px 9px;
  min-height: 34px;
  max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--water);
  box-shadow: 0 0 0 3px rgba(18, 132, 186, .2);
}
input[readonly] { background: var(--line-soft); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--water); width: 16px; height: 16px; vertical-align: -3px; margin: 0 4px 0 2px; }

input[type=submit], input[type=button], input[type=reset], button, .btn {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 34px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-s);
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color .15s, border-color .15s;
}
input[type=submit]:hover, input[type=button]:hover, input[type=reset]:hover, button:hover, .btn:hover {
  background: #f5f8f7; border-color: #8ba39f; color: var(--ink);
}
.btn:visited { color: var(--ink); }

/* primær knap (blå) */
.btn-primary, .btn-primary:visited, button.btn-primary {
  background: var(--water); border-color: var(--water); color: #fff;
}
.btn-primary:hover, button.btn-primary:hover { background: var(--water-deep); border-color: var(--water-deep); color: #fff; }
.btn-lg { font-size: 16px; padding: 10px 20px; min-height: 44px; }

/* "Slet"-knapper i admin får en advarselsfarve */
input[type=submit][value="Slet"], input[type=submit][value="SLET"], input[type=submit][value^="Slet "] {
  background: var(--surface); color: var(--danger); border-color: #e2b4af;
}
input[type=submit][value="Slet"]:hover, input[type=submit][value="SLET"]:hover, input[type=submit][value^="Slet "]:hover {
  background: var(--danger-tint); border-color: var(--danger); color: var(--danger);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  padding: 18px 20px 20px;
  margin: 0 0 20px;
}
legend {
  font-family: var(--font-cond);
  font-size: 1.12rem;
  font-weight: 600;
  padding: 0 6px;
  color: var(--ink);
}
label { cursor: pointer; }

/* ---------- tabeller (gamle sider bruger tabeller til layout og data) ---------- */
table { border-collapse: collapse; }
td, th { padding: 4px 8px; vertical-align: top; font-size: 15px; }
th { text-align: left; font-weight: 600; }

/* ======================================================================
   SIDEHOVED
   ====================================================================== */
.vs-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--ink); padding: 8px 14px; z-index: 100;
}
.vs-skip:focus { left: 8px; top: 8px; }

.vs-header {
  background: var(--ink);
  color: #dbe8e6;
  position: relative;
}
.vs-header__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 58px;
}
.vs-brand {
  display: flex; align-items: center; gap: 12px;
  color: #fff; text-decoration: none;
  margin-right: auto;
}
.vs-brand:visited, .vs-brand:hover { color: #fff; text-decoration: none; }
.vs-brand__mark { width: 36px; height: 36px; flex: none; background: #fff; border-radius: 6px; padding: 3px 9px; }
.vs-brand__name {
  font-family: var(--font-cond);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}
.vs-brand__name span { color: var(--water-light); font-weight: 600; }
.vs-brand__tag {
  display: block;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 400;
  color: #9fb8b4;
  margin-top: 3px;
  letter-spacing: 0;
}

.vs-nav { display: flex; align-items: center; gap: 4px; }
.vs-nav a {
  color: #c9dbd8;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 18px 11px 16px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.vs-nav a:visited { color: #c9dbd8; }
.vs-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.vs-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--water-light); }
.vs-nav__sep { width: 1px; height: 22px; background: rgba(255,255,255,.18); margin: 0 8px; }
.vs-nav a.vs-nav__login, .vs-nav a.vs-nav__login:visited {
  color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius-s);
  padding: 4px 12px; margin-left: 2px; font-weight: 600;
}
.vs-nav a.vs-nav__login:hover { background: rgba(255,255,255,.1); }
.vs-nav__user { color: #9fb8b4; font-size: 13px; padding: 0 6px; }

.vs-nav-toggle {
  display: none;
  background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 8px 12px; font-size: 15px;
}
.vs-nav-toggle:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); }

/* målestokken under topbjælken: små streger hver 10. px, større hver 50. */
.vs-ruler {
  height: 8px;
  background-color: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(79,179,227,.85) 2px, transparent 2px),
    linear-gradient(90deg, rgba(79,179,227,.4) 1px, transparent 1px);
  background-size: 50px 8px, 10px 4px;
  background-repeat: repeat-x;
  border-top: 1px solid rgba(255,255,255,.06);
}

@media (max-width: 900px) {
  .vs-nav-toggle { display: inline-block; }
  .vs-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink);
    padding: 8px var(--gutter) 16px;
    z-index: 50;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .vs-nav.is-open { display: flex; }
  .vs-nav a { padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .vs-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--water-light); padding-left: 12px; border-bottom-color: rgba(255,255,255,.08); }
  .vs-nav__sep { display: none; }
  .vs-nav a.vs-nav__login { margin: 12px 0 0; text-align: center; padding: 10px; }
  .vs-nav__user { padding: 12px 4px 0; }
  .vs-brand__tag { display: none; }
}

/* ======================================================================
   INDHOLD
   ====================================================================== */
.vs-main { display: block; }
.vs-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px var(--gutter) 56px;
}
/* gamle sider: brede tabeller kan rulles vandret i stedet for at sprænge layoutet */
.vs-legacy { overflow-x: auto; }
.vs-legacy > table, .vs-legacy table table { background: transparent; }
.vs-legacy table tr:hover > td { background: transparent; }

.vs-wrap--wide { max-width: none; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0; }

.vs-prose { max-width: 70ch; }
.vs-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.vs-muted { color: var(--muted); }
.vs-small { font-size: 14px; }

.vs-pagehead { padding: 8px 0 8px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.vs-pagehead h1 { margin-bottom: .2em; }
.vs-pagehead p { color: var(--muted); margin: 0 0 12px; max-width: 70ch; }

.vs-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px 22px;
}

.vs-notice {
  padding: 12px 16px;
  margin: 0 0 18px;
  border-radius: var(--radius-m);
  border: 1px solid #bcdcec;
  background: var(--water-tint);
  color: #0f4f6e;
  max-width: 80ch;
}
.vs-notice--error { background: var(--danger-tint); border-color: #ecbcb7; color: #7d1a14; }
.vs-notice--ok { background: var(--ok-tint); border-color: #bfdfca; color: #1f5636; }
.vs-notice--warn { background: var(--amber-tint); border-color: #edd3a6; color: #74460a; }

/* ---------- forside ---------- */
.vs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(16px, 4vw, 48px) 0 clamp(28px, 5vw, 56px);
}
.vs-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: .98;
  letter-spacing: -.02em;
  margin: 0 0 .35em;
  max-width: 13ch;
}
.vs-hero .vs-lede { margin-bottom: 1.6em; }
.vs-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* status-tavlen: skalapæl + aflæsning pr. målested */
.vs-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  display: grid;
  grid-template-columns: 44px 1fr;
  overflow: hidden;
}
.vs-board__gauge { background: var(--water-tint); position: relative; border-right: 1px solid #b8d9ea; }
.vs-board__gauge svg { display: block; width: 100%; height: 100%; }
.vs-board__body { padding: 18px 22px 16px; }
.vs-board__title { font-family: var(--font-cond); font-size: 1.25rem; font-weight: 600; margin: 0 0 2px; }
.vs-board__sub { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.vs-readings { list-style: none; margin: 0; padding: 0; }
.vs-readings li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.vs-readings li:first-child { border-top: 0; }
.vs-readings__n { font-family: var(--font-cond); font-size: 1.7rem; font-weight: 600; line-height: 1; }
.vs-readings__label { font-size: 16px; }
.vs-board__foot { font-size: 14px; color: var(--muted); margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }

.vs-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  transform: translateY(1px);
}
.vs-dot--1 { background: var(--t-overflade); }
.vs-dot--2 { background: var(--t-grundvand); }
.vs-dot--3 { background: var(--t-nedbor); }
.vs-dot--4 { background: var(--t-jord); }
.vs-dot--8 { background: var(--t-pause); box-shadow: inset 0 0 0 1.5px var(--muted); }

/* tre søjler om konceptet – adskilt af lodrette streger som på en målestok */
.vs-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
  margin-top: 8px;
}
.vs-pillar { padding: 22px 24px 8px 0; }
.vs-pillar + .vs-pillar { padding-left: 24px; border-left: 1px solid var(--line); }
.vs-pillar__icon { height: 56px; width: auto; display: block; margin-bottom: 14px; }
.vs-pillar img { height: 56px; width: auto; margin-bottom: 14px; mix-blend-mode: multiply; }
.vs-pillar h2 { font-size: 1.45rem; margin: 0 0 .5em; }
.vs-pillar p { font-size: 16px; color: var(--ink-soft); }

.vs-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin: 56px 0 0;
}
.vs-split figure { margin: 0; }
.vs-split figure img { border-radius: var(--radius-m); display: block; width: 100%; }
.vs-split figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

.vs-uses { columns: 2; column-gap: 32px; padding-left: 1.1em; margin: 0 0 1em; }
.vs-uses li { break-inside: avoid; margin-bottom: 4px; }

/* ---------- loggersiden: afsnit med billede ---------- */
.vs-sensor {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  padding: 32px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.vs-sensor:first-of-type { border-top: 0; }
.vs-sensor h2 { margin-top: 0; }
.vs-sensor figure { margin: 0; }
.vs-sensor img { border-radius: var(--radius-m); display: block; width: 100%; background: var(--surface); }
.vs-spec { list-style: none; padding: 0; margin: 0 0 1em; border-top: 1px solid var(--line-soft); }
.vs-spec li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 16px; }
.vs-spec li span:last-child { color: var(--muted); text-align: right; }

/* ---------- kontakt / formular ---------- */
.vs-two {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}
.vs-address { font-style: normal; line-height: 1.7; }
.vs-field { margin-bottom: 14px; }
.vs-field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.vs-field input, .vs-field select, .vs-field textarea { width: 100%; font-size: 16px; padding: 9px 11px; }
.vs-field-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }

/* ---------- login ---------- */
.vs-login {
  max-width: 420px;
  margin: 24px auto 0;
}
.vs-login .vs-panel { padding: 26px 28px; }
.vs-login h1 { font-size: 2rem; margin: 0 0 .2em; }

/* ---------- kort ---------- */
.vs-mapbar {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
}
.vs-mapbar h1 { font-size: 1.6rem; margin: 0 auto 0 0; }
.vs-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-filter label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  user-select: none;
}
.vs-filter input { position: absolute; opacity: 0; pointer-events: none; }
.vs-filter label:has(input:not(:checked)) { opacity: .45; }
.vs-filter label:has(input:focus-visible) { outline: 3px solid var(--water-light); outline-offset: 2px; }
.vs-filter__n { color: var(--muted); font-variant-numeric: tabular-nums; }

#map { width: 100%; height: calc(100vh - 58px - 9px - 70px); min-height: 460px; }

.mapboxgl-popup-content { font-family: var(--font); font-size: 14px; padding: 14px 16px 12px; border-radius: var(--radius-m); min-width: 230px; }
.vs-pop__name { font-family: var(--font-cond); font-size: 1.2rem; font-weight: 600; margin: 0 0 2px; padding-right: 14px; line-height: 1.15; }
.vs-pop__owner { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.vs-pop__value { font-family: var(--font-cond); font-size: 1.5rem; font-weight: 600; margin: 0; line-height: 1.1; }
.vs-pop__when { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.vs-pop__when.is-stale { color: var(--danger); }
.vs-pop table { width: 100%; border-top: 1px solid var(--line-soft); }
.vs-pop td { padding: 5px 0 0; font-size: 13px; }
.vs-pop td:first-child { color: var(--muted); padding-right: 10px; }
.vs-pop td a { margin-right: 8px; }

/* ---------- graf (plot.php) ---------- */
.vs-plot { padding: 16px var(--gutter) 24px; max-width: 1240px; margin: 0 auto; }
.vs-plot__head { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 24px; margin-bottom: 8px; }
.vs-plot__head h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 auto 0 0; }
.vs-plot__meta { color: var(--muted); font-size: 14px; margin: 0; }
.vs-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.vs-seg a { padding: 6px 12px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); }
.vs-seg a:first-child { border-left: 0; }
.vs-seg a:visited { color: var(--ink); }
.vs-seg a:hover { background: var(--water-tint); }
.vs-seg a[aria-current="true"] { background: var(--water); color: #fff; }
#chart { min-height: 340px; }
.vs-chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 8px 8px 0; }
.vs-plot__opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; font-size: 15px; }
.vs-plot__opts label { display: inline-flex; align-items: center; }
.vs-empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* ======================================================================
   ADMIN: TABELLER OG LOGGEROVERSIGT (samme stil som HYBER's tabeller)
   ====================================================================== */
.vs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vs-text-fare { color: var(--danger); }

.btn-small, button.btn-small, .btn.btn-small { min-height: 28px; padding: 2px 10px; font-size: 13.5px; }

.vs-listhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 14px; }
.vs-listhead h2 { margin: 0 auto 0 0; }
.vs-filter--form label { cursor: pointer; }

.vs-tablewrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow-x: auto;
}
.vs-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.vs-table th, .vs-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.vs-table thead th {
  background: #f4f8f7;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.vs-table tbody tr:hover > * { background: #f7fbfa; }
.vs-table .vs-num { text-align: right; color: var(--muted); }
.vs-table-empty { padding: 22px !important; color: var(--ink-soft); white-space: normal !important; }

/* stationsnavnet bliver stående i venstre side, hvis tabellen skal rulles på en smal skærm */
.vs-loggers .vs-station {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface);
  font-weight: 600;
  white-space: normal;
  min-width: 180px;
  max-width: 320px;
  box-shadow: 1px 0 0 var(--line-soft);
}
.vs-loggers thead th:first-child { left: 0; z-index: 3; }
.vs-loggers .vs-station a { color: var(--ink); text-decoration: none; }
.vs-loggers .vs-station a:hover { color: var(--water); text-decoration: underline; }
.vs-loggers .vs-actions-cell { text-align: right; }
.vs-loggers .vs-actions-cell .btn, .vs-loggers .vs-actions-cell button { margin-left: 4px; }
.vs-row-muted > td, .vs-row-muted > th { color: var(--muted); }
.vs-row-muted .vs-station a { color: var(--muted); }

.vs-editrow > td { background: #f7fbfd !important; border-top: 2px solid var(--water-tint); padding: 16px 16px 18px; white-space: normal; }
.vs-editgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 4px 16px;
  max-width: 1100px;
}
.vs-editgrid .vs-span2 { grid-column: span 2; }
.vs-editgrid .vs-field input, .vs-editgrid .vs-field select { font-size: 15px; padding: 6px 9px; }
.vs-editgrid .vs-check { display: flex; align-items: end; padding-bottom: 6px; }
.vs-editgrid .vs-check label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 15px; margin: 0; }
.vs-field input[type=checkbox], .vs-field input[type=radio] { width: 16px; height: 16px; padding: 0; min-height: 0; }
/* panelet bliver stående i skærmens bredde, også når tabellen er rullet */
.vs-editrow > td > form { position: sticky; left: 16px; max-width: calc(100vw - 2 * var(--gutter) - 34px); }
.vs-editactions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.vs-newlogger { margin-bottom: 18px; border-color: #b8d9ea; background: linear-gradient(#f4fafd, #fff 70%); }

.vs-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  padding: 1px 8px; border-radius: 999px;
  background: #edf2f1; color: var(--ink-soft);
  text-decoration: none; margin-left: 6px; vertical-align: 1px;
}
td > .vs-badge:first-child { margin-left: 0; }
a.vs-badge:hover { text-decoration: none; filter: brightness(.96); }
.vs-badge--ok, a.vs-badge--ok:visited { background: var(--ok-tint); color: #1f5636; }
.vs-badge--advarsel, a.vs-badge--advarsel:visited { background: var(--amber-tint); color: var(--amber); }
.vs-badge--fare, a.vs-badge--fare:visited { background: var(--danger-tint); color: var(--danger); }

@media (max-width: 700px) {
  .vs-hide-sm { display: none; }
  .vs-editgrid { grid-template-columns: 1fr 1fr; }
  .vs-editgrid .vs-span2 { grid-column: 1 / -1; }
  .vs-loggers .vs-station { min-width: 140px; }
}

/* ======================================================================
   ADMIN: LOGGERDATA OG ÆLDRE TABEL-FORMULARER
   ====================================================================== */
/* celler der kun indeholder knapper (Ret/Slet/Opret): på én linje og lodret centreret */
.vs-legacy td:has(> input[type=submit]):not(:has(> :not(input[type=submit]):not(input[type=hidden]))) {
  white-space: nowrap;
  vertical-align: middle;
}
.vs-legacy td > input[type=submit] + input[type=submit] { margin-left: 6px; }
/* knap-celler markeret i PHP (virker også i browsere uden :has) */
.vs-legacy td.vs-btns { white-space: nowrap; vertical-align: middle; }
.vs-legacy td.vs-btns > input[type=submit] + input[type=submit] { margin-left: 6px; }
/* gamle tabeller: celler centreres lodret, undtagen layout-celler med valign=top */
.vs-legacy td { vertical-align: middle; }
.vs-legacy td[valign="top"], .vs-legacy td[valign="TOP"] { vertical-align: top; }
/* rækker med indtastningsfelter: centrér cellerne lodret */
.vs-legacy tr:has(> td > input[type=text]) > td,
.vs-legacy tr:has(> td > textarea) > td { vertical-align: middle; }
.vs-legacy textarea { min-height: 64px; width: 100%; min-width: 240px; resize: vertical; }

/* faste bredder til felter med size-attribut (gamle formularer), så tabellerne ikke bliver unødigt brede */
.vs-legacy input[size="19"], .vs-legacy input[size="20"] { width: 12em; }
.vs-legacy input[size="15"] { width: 9em; }
.vs-legacy input[size="10"] { width: 7em; }
.vs-legacy input[size="5"], .vs-legacy input[size="3"] { width: 4.5em; }

/* funktionspanelerne i højre side: labels og felter står pænt under hinanden */
.vs-legacy table:has(> tbody > tr > td.vs-toolcol) { width: 100%; }
.vs-toolcol { width: 370px; min-width: 340px; padding-left: 24px !important; padding-right: 0 !important; }
.vs-tools fieldset { margin-bottom: 14px; min-width: 0; }
.vs-fgrid { display: grid; gap: 8px; }
.vs-frow { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
.vs-frow > label, .vs-flabel { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.vs-frow > input[type=text], .vs-frow > select, .vs-frow select { width: 100%; max-width: 13.5em; min-width: 0; }
.vs-frow input[type=file] { font-size: 14px; max-width: 100%; }
.vs-frow--btn { padding-top: 4px; }
.vs-frow--btn > :first-child { grid-column: 2; justify-self: start; }
.vs-fchoice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; }
.vs-pair { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-weight: 500; }
.vs-w-s { width: 5em !important; }
input[type=submit].vs-btn-fare { color: var(--danger); border-color: #e2b4af; }
input[type=submit].vs-btn-fare:hover { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }

/* "Til toppen" */
.vs-totop { margin: 24px 0 0; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

@media (max-width: 900px) {
  .vs-toolcol { width: auto; min-width: 320px; padding-left: 8px !important; }
}

/* ======================================================================
   SIDEFOD
   ====================================================================== */
.vs-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 15px;
}
.vs-footer__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px var(--gutter) 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 24px 40px;
}
.vs-footer h2 { font-size: 1.1rem; margin: 0 0 .5em; }
.vs-footer p { margin: 0 0 .4em; }
.vs-footer ul { list-style: none; margin: 0; padding: 0; }
.vs-footer li { margin-bottom: 4px; }

/* ======================================================================
   SMÅ SKÆRME
   ====================================================================== */
@media (max-width: 860px) {
  .vs-hero, .vs-split, .vs-sensor, .vs-two { grid-template-columns: 1fr; }
  .vs-pillars { grid-template-columns: 1fr; border-top-width: 2px; }
  .vs-pillar { padding: 20px 0 4px; }
  .vs-pillar + .vs-pillar { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .vs-footer__inner { grid-template-columns: 1fr; }
  .vs-uses { columns: 1; }
  #map { height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .vs-header, .vs-ruler, .vs-footer, .vs-nav-toggle, .vs-skip { display: none; }
  body { background: #fff; }
}

/* sorterbare kolonneoverskrifter i loggeroversigten */
.vs-table thead th .vs-sortlink, .vs-table thead th .vs-sortlink:visited {
  color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
}
.vs-table thead th .vs-sortlink:hover { color: var(--water); text-decoration: underline; }
.vs-table thead th .vs-sortlink.is-aktiv { color: var(--ink); }
.vs-table thead th .vs-sortlink span { font-size: 10px; color: var(--water); }
