/* RemTool styling after remborg.nl: dark grey #333333, RemBorg green #009933 / logo green #058C38, amber accent
   #edaa41, light grey #f1f1f1 and the Mulish font (self-hosted). Layout: fixed menu bar on the left. */
@font-face {
    font-family: 'Mulish';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url(/Web/mulish-latin.woff2) format('woff2');
}
:root {
    --rb-dark: #333333; --rb-darker: #262626; --rb-green: #009933; --rb-green-dark: #058C38; --rb-green-light: #e6f5eb;
    --rb-amber: #edaa41; --rb-amber-dark: #d8932a; --rb-light: #f1f1f1;
    --card: #fff; --border: #e2e2e2; --text: #2f2f2f; --muted: #6b6b6b;
    --danger: #c62828; --ok: #058C38; --warn: #b26a00;
    --radius: 6px; --radius-lg: 10px;
    --sidebar-width: 240px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .06);
    --shadow-md: 0 4px 10px -2px rgb(0 0 0 / .12);
    --font: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); background: var(--rb-light); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--rb-green-dark); }
a:hover { color: var(--rb-green); }
code { background: var(--rb-light); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* App layout: menu bar on the left, content on the right. */
body.app { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--rb-dark); color: #fff; display: flex; flex-direction: column; z-index: 1000; }
.sidebar .brand { display: block; padding: 22px 20px 18px; border-bottom: 1px solid rgb(255 255 255 / .08); text-decoration: none; color: #fff; }
.sidebar .brand img { width: 100%; max-width: 180px; display: block; }
.sidebar .brand span { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--rb-amber); }
.sidebar nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: rgb(255 255 255 / .82); text-decoration: none; font-weight: 600; border-left: 4px solid transparent; transition: background-color .15s, color .15s; }
.sidebar nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.sidebar nav a:hover { background: rgb(255 255 255 / .06); color: #fff; }
.sidebar nav a.active { background: rgb(0 153 51 / .16); border-left-color: var(--rb-green); color: #fff; }
.sidebar nav a .count { margin-left: auto; background: var(--rb-amber); color: var(--rb-dark); border-radius: 9999px; font-size: 11px; font-weight: 800; padding: 0 8px; }
.sidebar .account { padding: 16px 20px; border-top: 1px solid rgb(255 255 255 / .08); font-size: 13px; }
.sidebar .account .name { font-weight: 700; }
.sidebar .account .email { color: rgb(255 255 255 / .6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .account a { display: inline-block; margin-top: 8px; color: var(--rb-amber); text-decoration: none; font-weight: 700; }
.sidebar .account a:hover { color: #fff; }
.menu-toggle { display: none; }

.main { min-width: 0; }
.content { max-width: 1280px; padding: 28px 32px; }
.page-title { margin: 0 0 20px; font-size: 26px; font-weight: 800; color: var(--rb-dark); letter-spacing: -.01em; }
.page-title small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.card h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; color: var(--rb-dark); }
.card h2 .badge { margin-left: 8px; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 700; font-size: 13px; }
input[type=checkbox] { accent-color: var(--rb-green); width: 16px; height: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
    padding: 9px 12px; border: 1px solid #cfcfcf; border-radius: var(--radius); font: inherit; width: 100%; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rb-green); box-shadow: 0 0 0 3px rgb(0 153 51 / .18); }

button, .btn { background: var(--rb-green); color: #fff; border: none; border-radius: var(--radius); padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; transition: background-color .15s, box-shadow .15s; }
button:hover, .btn:hover { background: var(--rb-green-dark); color: #fff; }
button.cta { background: var(--rb-amber); color: var(--rb-dark); }
button.cta:hover { background: var(--rb-amber-dark); }
button.secondary { background: #fff; color: var(--text); border: 1px solid #cfcfcf; }
button.secondary:hover { background: var(--rb-light); }
button.danger { background: var(--danger); }
button.danger:hover { background: #a61f1f; }
button.small, .btn.small { padding: 4px 12px; font-size: 12px; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid #cfcfcf; }
.btn.secondary:hover { background: var(--rb-light); color: var(--text); }
button:disabled { opacity: .6; cursor: default; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr:hover td { background: #fafafa; }
tr.highlight td { background: var(--rb-green-light); }
td:has(> button) { white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 9999px; font-size: 12px; font-weight: 700; background: var(--rb-light); color: var(--muted); }
.badge.ok { background: var(--rb-green-light); color: var(--ok); }
.badge.err { background: #fde7e7; color: var(--danger); }
.badge.warn { background: #fdf0db; color: var(--warn); }

.toast { position: fixed; right: 20px; bottom: 20px; padding: 12px 18px; border-radius: var(--radius); color: #fff; background: var(--rb-green); box-shadow: var(--shadow-md); max-width: 440px; z-index: 2000; white-space: pre-wrap; font-weight: 600; }
.toast.err { background: var(--danger); }
.toast.warn { background: var(--rb-amber); color: var(--rb-dark); }
.toast + .toast { bottom: 80px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { background: none; color: var(--muted); border-radius: 0; border-bottom: 3px solid transparent; font-weight: 700; padding: 10px 14px; }
.tabs button:hover { color: var(--text); background: none; }
.tabs button.active { color: var(--rb-dark); border-bottom-color: var(--rb-green); }

.tab-bar { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-bar .tabs { flex: 1; min-width: 0; border-bottom: none; margin-bottom: 0; flex-wrap: wrap; }
.tab-bar .tabs button { white-space: nowrap; }
.tab-bar > button { margin-bottom: 6px; white-space: nowrap; }
.tabs button .mark { margin-left: 6px; font-size: 11px; color: var(--warn); }
.tabs button.loading::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 7px; border: 2px solid #cfcfcf; border-top-color: var(--rb-green); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dialog on top of the page (above the toast). */
.modal-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 3000; }
.modal { background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 20px 40px -12px rgb(0 0 0 / .45); width: 100%; max-width: 480px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--rb-dark); }
.modal-close { font-size: 18px; line-height: 1; padding: 4px 10px; }
.modal-body { padding: 14px 22px 22px; overflow-y: auto; }
.check-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius); cursor: pointer; }
.check-list label:hover { background: var(--rb-light); }
.check-list label.all { font-weight: 700; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 4px; }
.check-list label.disabled { color: var(--muted); cursor: default; }
.check-list label small { margin-left: auto; color: var(--muted); }

.hidden { display: none !important; }

/* Login page: dark/green brand panel with a white card. */
body.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: linear-gradient(135deg, var(--rb-darker) 0%, var(--rb-dark) 55%, var(--rb-green-dark) 140%); }
.login-box { width: 100%; max-width: 420px; }
.login-box .logo { display: block; width: 240px; max-width: 80%; margin: 0 auto 8px; }
.login-box .tagline { text-align: center; color: var(--rb-amber); font-weight: 800; letter-spacing: .18em; text-transform: uppercase; font-size: 13px; margin-bottom: 22px; }
.login-box .card { padding: 26px; box-shadow: 0 20px 40px -12px rgb(0 0 0 / .45); border: none; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box button[type=submit] { width: 100%; padding: 11px; margin-top: 4px; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--rb-green-light); color: var(--rb-green-dark); font-weight: 600; }
.notice.warn { background: #fdf0db; color: var(--warn); }

/* Home: search bar, map and results. */
.search-bar { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: end; }
.autocomplete { position: relative; }
.autocomplete ul { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 1500; max-height: 320px; overflow-y: auto; }
.autocomplete li { padding: 8px 12px; cursor: pointer; }
.autocomplete li .type { float: right; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.autocomplete li:hover, .autocomplete li.active { background: var(--rb-green-light); }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
#map { height: 520px; border-radius: var(--radius-lg); border: 1px solid var(--border); z-index: 0; }
.map-card { padding: 0; overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .3); }
.dot-site { background: var(--rb-amber); }
.dot-cpt { background: #1f78b4; }
.dot-bhr { background: #8c510a; }
.dot-gmw { background: #00a6a6; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding-top: 2px; }
dl.facts dd { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.stat { background: var(--rb-light); border-radius: var(--radius); padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 800; color: var(--rb-dark); }
.stat span { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.empty { color: var(--muted); padding: 10px 0; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content { font-size: 13px; }
.leaflet-control-layers-expanded { font-family: var(--font); font-weight: 600; }
/* Leaflet's own icon is a PNG the server does not serve; use an inline icon for the collapsed layer list. */
.leaflet-control-layers-toggle, .leaflet-retina .leaflet-control-layers-toggle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 8l10 5 10-5-10-5z'/%3E%3Cpath d='m2 12.5 10 5 10-5M2 17l10 5 10-5'/%3E%3C/svg%3E"); background-size: 24px 24px; width: 40px; height: 40px; }
.leaflet-control-layers-overlays label { font-weight: 500; }

/* Source tabs: facts, image, tables and links of one information source. */
.source-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.source-head h2 { margin: 0; }
.source-summary { color: var(--muted); margin: 0 0 14px; max-width: 900px; }
.source-card .notice { margin-bottom: 12px; }
.source-card dl.facts { margin-bottom: 16px; }
.source-card h3 { margin: 20px 0 6px; font-size: 14px; font-weight: 800; color: var(--rb-dark); }
.source-image { margin: 0 0 6px; }
.source-image img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.source-image .placeholder { padding: 36px 16px; text-align: center; color: var(--muted); background: var(--rb-light); border-radius: var(--radius); }
.source-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.source-loading { color: var(--muted); padding: 12px 0; }

/* Narrow screens: menu bar becomes an overlay behind a hamburger button. */
@media (max-width: 900px) {
    .map-layout { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
    body.app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-width); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-md); }
    body.menu-open .sidebar { transform: none; }
    .menu-toggle { display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 1100; padding: 8px 12px; background: var(--rb-dark); }
    body.menu-open .menu-toggle { left: calc(var(--sidebar-width) + 12px); }
    .content { padding: 64px 16px 24px; }
    .search-bar { grid-template-columns: 1fr; }
    #map { height: 380px; }
}
