/* ══════════════════════════════════════════════════════════════
   BrugOpen — visueel systeem gebaseerd op brugopen-v3.html
   Prefix: bo-
   ══════════════════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --bo-bg:        #f5f4f0;
  --bo-surface:   #ffffff;
  --bo-surface2:  #f0efe9;
  --bo-surface3:  #e8e6de;
  --bo-border:    #e2e0d8;
  --bo-border2:   #ccc9be;
  --bo-text:      #181714;
  --bo-muted:     #72706a;
  --bo-faint:     #aaa8a2;

  --bo-green:     #1a6648;
  --bo-green-bg:  #eaf3ee;
  --bo-green-b:   #b8d9c8;

  --bo-amber:     #8a5c00;
  --bo-amber-bg:  #fdf4e0;
  --bo-amber-b:   #f0d080;

  --bo-red:       #c0392b;
  --bo-red-bg:    #fdeaea;
  --bo-red-b:     #f0b0b0;

  --bo-blue:      #1a3f7a;
  --bo-blue-bg:   #eaeff8;
  --bo-blue-b:    #b0c4e8;

  --bo-r:         6px;
  --bo-r-lg:      10px;
  --bo-shadow:    0 1px 3px rgba(0,0,0,.06);
  --bo-shadow-lg: 0 4px 20px rgba(0,0,0,.10);
}

/* ── ANIMATIES ── */
/* boFadeUp: zelfde gevoel als de reference (fadeUp in brugopen-v3.html) */
@keyframes boFadeUp  { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@keyframes boFadeIn  { from{opacity:0} to{opacity:1} }
@keyframes boSlideUp { from{opacity:0;transform:translateY(22px)} to{opacity:1;transform:translateY(0)} }
@keyframes boPulse   { 0%,100%{opacity:1} 50%{opacity:.25} }
@keyframes boBlink   { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes boSpin    { to{transform:rotate(360deg)} }

/* ── SHELL ── */
.bo-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bo-bg);
  color: var(--bo-text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── HEADER ── */
.bo-header {
  background: var(--bo-surface);
  border-bottom: 1px solid var(--bo-border);
  position: sticky;
  top: 0;
  z-index: 400;
  flex-shrink: 0;
}
.bo-header-inner {
  max-width: none;
  margin: 0;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.bo-logo {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--bo-text);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.bo-logo em { color: var(--bo-green); font-style: normal; }

.bo-nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.bo-nav::-webkit-scrollbar { display: none; }
.bo-nav-btn {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: var(--bo-r);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--bo-muted);
  transition: all .15s;
  white-space: nowrap;
}
.bo-nav-btn:hover    { background: var(--bo-surface2); color: var(--bo-text); }
.bo-nav-btn.active   { background: var(--bo-surface2); color: var(--bo-text); font-weight: 500; }

.bo-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
}

/* Live pill */
.bo-live-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--bo-green);
  letter-spacing: .05em;
  background: var(--bo-green-bg);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--bo-green-b);
  white-space: nowrap;
}
.bo-live-off { color: var(--bo-muted); background: var(--bo-surface2); border-color: var(--bo-border); }
.bo-live-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: boBlink 2s ease-in-out infinite;
}
.bo-live-off .bo-live-dot { animation: none; opacity: .5; }

.bo-clk {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--bo-muted);
}
.bo-icon-btn {
  width: 30px; height: 30px;
  border-radius: var(--bo-r);
  border: 1px solid var(--bo-border);
  background: none;
  cursor: pointer;
  color: var(--bo-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  text-decoration: none;
  transition: all .15s;
}
.bo-icon-btn:hover { background: var(--bo-surface2); color: var(--bo-text); }

/* ── REGIO-BALK ── */
.bo-region-bar {
  background: var(--bo-surface);
  border-bottom: 1px solid var(--bo-border);
  padding: 0 24px;
  position: sticky;
  top: 52px;
  z-index: 300;
  flex-shrink: 0;
}
.bo-region-inner {
  max-width: none;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  overflow-x: auto;
}
.bo-region-inner::-webkit-scrollbar { display: none; }
.bo-rf-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--bo-faint);
  text-transform: uppercase;
  flex-shrink: 0;
  margin-right: 2px;
}
.bo-rf-btn {
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--bo-border);
  background: none;
  color: var(--bo-muted);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.bo-rf-btn:hover { border-color: var(--bo-green); color: var(--bo-green); }
.bo-rf-btn.active {
  background: var(--bo-green);
  border-color: var(--bo-green);
  color: #fff;
  font-weight: 500;
}
.bo-rf-count {
  margin-left: auto;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--bo-faint);
  flex-shrink: 0;
}

/* ── TICKER / LOPENDE BALK ── */
.bo-ticker {
  background: var(--bo-green);
  overflow: hidden;
  height: 28px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 100%;
  cursor: pointer;
  user-select: none;
}
.bo-ticker-inner {
  display: flex;
  white-space: nowrap;
  /* breedte wordt door JS bepaald na klonen van items */
  will-change: transform;
  flex-shrink: 0;
}
.bo-ticker-item {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,.85);
  padding: 0 28px;
  border-right: 1px solid rgba(255,255,255,.2);
  letter-spacing: .04em;
  flex-shrink: 0;
}
.bo-ticker-lbl {
  opacity: .5;
  margin-right: 7px;
}

/* ── WRAP ── */
.bo-wrap {
  max-width: none;
  margin: 0;
  padding: 20px 24px 60px;
  flex: 1;
}
/* kaartpanel: volledige breedte, geen max-width, compacte padding */
.bo-wrap.bo-wrap--map {
  max-width: none;
  margin: 0;
  padding: 12px 24px 16px;
}

/* ── PANELS ── */
.bo-panel { display: none; }

/*
  Panel verschijnen — werkt bij elke panelwissel (niet alleen bij eerste laden):
  @starting-style + transition zorgt dat de browser de beginstaat
  herkent bij display:none → display:block en de transitie afspeelt.
*/
.bo-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .3s cubic-bezier(0.16,1,0.3,1),
    transform .35s cubic-bezier(0.16,1,0.3,1);
}

@starting-style {
  .bo-panel.active {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* Pre-hide tijdens laden (vóór bo-loaded): geen flits bij eerste render */
.bo-shell:not(.bo-loaded) .bo-panel.active {
  opacity: 0;
  transform: translateY(12px);
  transition: none;
}


/* ── PAGE HEADER ── */
.bo-page-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--bo-border);
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.bo-shell:not(.bo-loaded) .bo-page-hd { opacity: 0; }
.bo-shell.bo-loaded .bo-page-hd { animation: boFadeUp .35s cubic-bezier(0.16,1,0.3,1) forwards; }
/* compacte variant voor kaartpanel: minder ruimte onder de header */
.bo-page-hd--compact {
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.bo-page-hd h1 { font-size: 19px; font-weight: 500; letter-spacing: -.03em; }
.bo-page-hd p  { font-size: 12px; color: var(--bo-muted); margin-top: 2px; }
.bo-page-hd-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bo-upd-label { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--bo-faint); }
.bo-legend { display: flex; align-items: center; gap: 12px; font-size: 12px; flex-wrap: wrap; }

/* bo-panel--kaart: geen extra flex nodig, hoogte via map-container calc */

/* ── ALERT ── */
.bo-alert {
  border-radius: var(--bo-r);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 13px;
}
.bo-alert-err  { background: var(--bo-red-bg);   border: 1px solid var(--bo-red-b);   color: var(--bo-red); }
.bo-alert-warn { background: var(--bo-amber-bg);  border: 1px solid var(--bo-amber-b); color: var(--bo-amber); }
.bo-alert-info { background: var(--bo-blue-bg);   border: 1px solid var(--bo-blue-b);  color: var(--bo-blue); }
.bo-alert-suc  { background: var(--bo-green-bg);  border: 1px solid var(--bo-green-b); color: var(--bo-green); }

/* ── STAT CARDS ── */
.bo-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 900px) { .bo-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .bo-stats { grid-template-columns: 1fr 1fr; } }
.bo-stat {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: all .2s;
}
.bo-shell:not(.bo-loaded) .bo-stat { opacity: 0; }
.bo-shell.bo-loaded .bo-stat {
  animation: boFadeUp .45s cubic-bezier(0.16,1,0.3,1) forwards;
}
.bo-shell.bo-loaded .bo-stat:nth-child(1) { animation-delay: .04s; }
.bo-shell.bo-loaded .bo-stat:nth-child(2) { animation-delay: .09s; }
.bo-shell.bo-loaded .bo-stat:nth-child(3) { animation-delay: .14s; }
.bo-shell.bo-loaded .bo-stat:nth-child(4) { animation-delay: .19s; }
.bo-shell.bo-loaded .bo-stat:nth-child(5) { animation-delay: .24s; }
.bo-stat:hover { border-color: var(--bo-green); box-shadow: var(--bo-shadow-lg); transform: translateY(-2px); }
.bo-stat-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bo-muted);
  margin-bottom: 6px;
}
.bo-stat-num {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: 1;
  color: var(--bo-card-col, var(--bo-text));
}
.bo-stat-sub { font-size: 11px; color: var(--bo-faint); margin-top: 3px; }
.bo-stat-tag {
  display: inline-block;
  margin-top: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
}
.bo-tag-g { background: var(--bo-green-bg); color: var(--bo-green); }
.bo-tag-a { background: var(--bo-amber-bg); color: var(--bo-amber); }
.bo-tag-b { background: var(--bo-blue-bg);  color: var(--bo-blue);  }
.bo-tag-n { background: var(--bo-surface2); color: var(--bo-muted); }

/* ── CARD ── */
.bo-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-lg);
  overflow: hidden;
  box-shadow: var(--bo-shadow);
}
.bo-card-hd {
  padding: 13px 18px;
  border-bottom: 1px solid var(--bo-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bo-card-title { font-size: 13px; font-weight: 500; }
.bo-card-meta  { font-size: 12px; color: var(--bo-muted); }
.bo-card-body  { padding: 18px; }

/* ── GRIDS ── */
.bo-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.bo-g3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .bo-g2, .bo-g3-1 { grid-template-columns: 1fr; } }
/* Staggered card fade-in binnen grids — alleen bij eerste load */
.bo-shell.bo-loaded .bo-g2 > .bo-card,
.bo-shell.bo-loaded .bo-g3-1 > .bo-card {
  animation: boFadeUp .35s ease both;
  animation-fill-mode: forwards;
}
.bo-shell.bo-loaded .bo-g2 > .bo-card:nth-child(1),
.bo-shell.bo-loaded .bo-g3-1 > .bo-card:nth-child(1) { animation-delay: .08s; }
.bo-shell.bo-loaded .bo-g2 > .bo-card:nth-child(2),
.bo-shell.bo-loaded .bo-g3-1 > .bo-card:nth-child(2) { animation-delay: .18s; }
/* Standalone kaarten direct onder actief panel */
.bo-shell.bo-loaded .bo-panel.active > .bo-card {
  animation: boFadeUp .38s ease both;
  animation-fill-mode: forwards;
  animation-delay: .12s;
}

/* ── MAP LAYOUT ── */
/*
  Sticky-hoogtes boven de kaart:
    header      52px
    regio-balk  40px
    ticker      28px
    wrap-padding + page-hd + alerts  ~68px
    totaal: ~188px => we gebruiken 190px voor nette afsluiting
*/
.bo-map-panel-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 960px) { .bo-map-panel-wrap { grid-template-columns: 1fr; } }
.bo-map-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bo-map-container {
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 480px;
  border-radius: 0 0 var(--bo-r-lg) var(--bo-r-lg);
}
.bo-map-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  position: sticky;
  top: calc(52px + 40px + 28px + 12px); /* header + regio + ticker + wrap-padding */
}
.bo-map-sidebar::-webkit-scrollbar { width: 4px; }
.bo-map-sidebar::-webkit-scrollbar-thumb { background: var(--bo-border); border-radius: 2px; }

/* ── STATUS SIGNALEN ── */
.bo-signals { display: flex; flex-direction: column; gap: 9px; }
.bo-signals > div {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.bo-sig-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bo-sig-urgent-dot   { background: var(--bo-red);   box-shadow: 0 0 6px rgba(192,57,43,.5); animation: boPulse 1.5s ease-in-out infinite; }
.bo-sig-warning-dot  { background: var(--bo-amber); }
.bo-sig-available-dot{ background: var(--bo-green); }
.bo-sig-num { font-family: 'DM Mono', monospace; font-size: 13px; }
.bo-sig-urgent   { color: var(--bo-red); }
.bo-sig-warning  { color: var(--bo-amber); }
.bo-sig-available{ color: var(--bo-green); }

/* ── ALARM BADGE & LIST ── */
.bo-alarm-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bo-red-bg);
  color: var(--bo-red);
  border: 1px solid var(--bo-red-b);
}
.bo-alarm-list {
  font-size: 12px;
  max-height: 220px;
  overflow-y: auto;
}
.bo-alarm-row {
  padding: 8px 14px;
  border-bottom: 1px solid var(--bo-border);
  display: flex;
  align-items: flex-start;
  gap: 7px;
  transition: background .12s;
}
.bo-alarm-row:hover { background: var(--bo-surface2); }
.bo-alarm-row:last-child { border-bottom: none; }
.bo-alarm-name { font-size: 11px; font-weight: 500; margin-bottom: 2px; }
.bo-alarm-loc  { color: var(--bo-muted); font-weight: 400; }
.bo-alarm-text {
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 7px;
}
.bo-alarm-urgent  { background: var(--bo-red-bg);   border: 1px solid var(--bo-red-b);   color: var(--bo-red); }
.bo-alarm-warning { background: var(--bo-amber-bg); border: 1px solid var(--bo-amber-b); color: var(--bo-amber); }

/* ── BADGES ── */
.bo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.bo-bd { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.bo-b-open  { background: var(--bo-green-bg); color: var(--bo-green); border: 1px solid var(--bo-green-b); }
.bo-b-open .bo-bd { background: var(--bo-green); animation: boPulse 1.5s ease-in-out infinite; }
.bo-b-plan  { background: var(--bo-blue-bg);  color: var(--bo-blue);  border: 1px solid var(--bo-blue-b); }
.bo-b-plan .bo-bd { background: var(--bo-blue); }
.bo-b-mnt   { background: var(--bo-amber-bg); color: var(--bo-amber); border: 1px solid var(--bo-amber-b); }
.bo-b-mnt .bo-bd { background: var(--bo-amber); }
.bo-b-cls   { background: var(--bo-surface2); color: var(--bo-muted); border: 1px solid var(--bo-border); }
.bo-b-cls .bo-bd { background: var(--bo-border2); }

/* ── BRIDGE ROWS ── */
.bo-bridge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--bo-border);
  transition: background .12s;
}
.bo-bridge-row:last-child { border-bottom: none; }
.bo-bridge-row:hover { background: var(--bo-surface2); }
.bo-bridge-row:hover .bo-br-arr { opacity: 1; transform: translateX(2px); }
.bo-br-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.bo-bridge-name { font-size: 13px; font-weight: 500; }
.bo-bridge-loc  { font-size: 11px; color: var(--bo-muted); }
.bo-bridge-time { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--bo-muted); white-space: nowrap; }
.bo-br-arr { color: var(--bo-faint); opacity: 0; transition: all .2s; font-size: 14px; margin-left: auto; }

/* ── TABLE ── */
.bo-fbar {
  padding: 8px 14px;
  border-bottom: 1px solid var(--bo-border);
  background: var(--bo-surface2);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.bo-fb {
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 20px;
  border: 1px solid var(--bo-border);
  background: var(--bo-surface);
  color: var(--bo-muted);
  cursor: pointer;
  transition: all .15s;
}
.bo-fb:hover, .bo-fb.active { border-color: var(--bo-green); color: var(--bo-green); background: var(--bo-green-bg); }
.bo-fb.active { font-weight: 500; }
.bo-fb-cnt { font-family: 'DM Mono', monospace; font-size: 10px; opacity: .7; margin-left: 3px; }
.bo-srch {
  margin-left: auto;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r);
  background: var(--bo-surface);
  color: var(--bo-text);
  outline: none;
  width: 160px;
}
.bo-srch:focus { border-color: var(--bo-green); }
.bo-tbl-wrap { overflow: auto; max-height: 480px; }
.bo-tbl-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.bo-tbl-wrap::-webkit-scrollbar-thumb { background: var(--bo-border); border-radius: 2px; }
.bo-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.bo-tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bo-surface2);
  padding: 8px 13px;
  font-family: 'DM Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--bo-muted);
  border-bottom: 1px solid var(--bo-border);
  white-space: nowrap;
  user-select: none;
  text-align: left;
}
.bo-tbl tbody td { padding: 9px 13px; border-bottom: 1px solid var(--bo-border); vertical-align: middle; }
.bo-tbl tbody tr:last-child td { border-bottom: none; }
.bo-tbl tbody tr { transition: background .1s; }
.bo-tbl tbody tr:hover td { background: var(--bo-surface2); }
.bo-td-name { font-weight: 500; }
.bo-td-mono { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--bo-muted); }

/* ── PROGRESS BARS ── */
.bo-prog-list { display: flex; flex-direction: column; gap: 9px; }
.bo-prog-item { }
.bo-prog-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.bo-prog-name { font-size: 13px; font-weight: 500; }
.bo-prog-val  { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--bo-muted); }
.bo-prog-rank { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--bo-faint); margin-right: 5px; }
.bo-prog-bar {
  height: 4px;
  background: var(--bo-surface2);
  border-radius: 2px;
  overflow: hidden;
}
.bo-prog-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--bo-green);
  width: 0;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* ── MODAL ── */
.bo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: boFadeUp .15s ease;
}
.bo-modal {
  background: var(--bo-surface);
  border-radius: var(--bo-r-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
  overflow: hidden;
  animation: boFadeUp .22s ease;
}
.bo-modal-hd {
  padding: 18px 22px;
  border-bottom: 1px solid var(--bo-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bo-modal-title { font-size: 15px; font-weight: 500; letter-spacing: -.02em; }
.bo-modal-close {
  width: 28px; height: 28px;
  border-radius: var(--bo-r);
  border: 1px solid var(--bo-border);
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--bo-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.bo-modal-close:hover { background: var(--bo-surface2); }
.bo-modal-body { padding: 20px 22px; }
.bo-modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.bo-modal-stat {
  background: var(--bo-surface2);
  border-radius: var(--bo-r);
  padding: 10px 12px;
}
.bo-modal-stat-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--bo-muted);
  margin-bottom: 3px;
}
.bo-modal-stat-val { font-size: 18px; font-weight: 300; letter-spacing: -.03em; }
.bo-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--bo-border);
  font-size: 13px;
}
.bo-modal-row:last-child { border-bottom: none; }
.bo-modal-key  { color: var(--bo-muted); }
.bo-modal-mono { font-family: 'DM Mono', monospace; font-size: 12px; }
.bo-modal-alarm {
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 12px;
  margin-top: 6px;
}

/* ── LOADING ── */
.bo-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  font-size: 13px;
  color: var(--bo-muted);
}
.bo-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--bo-border);
  border-top-color: var(--bo-green);
  border-radius: 50%;
  animation: boSpin .8s linear infinite;
}

/* ── LEGE STAAT ── */
.bo-empty {
  padding: 14px 18px;
  color: var(--bo-muted);
  font-size: 13px;
  text-align: center;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--bo-border); border-radius: 3px; }

/* ── DARK MODE ── */
/* Ondersteunt zowel data-theme="dark" op <html> (amsMonitoring.setTheme) als body.dark */
[data-theme="dark"] .bo-shell,
.dark .bo-shell,
body.dark .bo-shell {
  --bo-bg:        #131210;
  --bo-surface:   #1c1a17;
  --bo-surface2:  #242119;
  --bo-surface3:  #2c2920;
  --bo-border:    #2e2b26;
  --bo-border2:   #3e3b34;
  --bo-text:      #f0ede8;
  --bo-muted:     #888480;
  --bo-faint:     #555250;
  --bo-green-bg:  #0f2218;
  --bo-green-b:   #1a4030;
  --bo-amber-bg:  #1a1200;
  --bo-amber-b:   #3a2800;
  --bo-red-bg:    #1a0a0a;
  --bo-red-b:     #3a1414;
  --bo-blue-bg:   #0a0f1a;
  --bo-blue-b:    #142040;
}
[data-theme="dark"] .bo-ticker,
body.dark .bo-ticker { background: #0f4a32; }

/* ── LIGHT MODE (expliciete override voor als dark default is) ── */
[data-theme="light"] .bo-shell {
  --bo-bg:        #f5f4f0;
  --bo-surface:   #ffffff;
  --bo-surface2:  #f0efe9;
  --bo-surface3:  #e8e6de;
  --bo-border:    #e2e0d8;
  --bo-border2:   #ccc9be;
  --bo-text:      #181714;
  --bo-muted:     #72706a;
  --bo-faint:     #aaa8a2;
  --bo-green-bg:  #eaf3ee;
  --bo-green-b:   #b8d9c8;
  --bo-amber-bg:  #fdf4e0;
  --bo-amber-b:   #f0d080;
  --bo-red-bg:    #fdeaea;
  --bo-red-b:     #f0b0b0;
  --bo-blue-bg:   #eaeff8;
  --bo-blue-b:    #b0c4e8;
}
[data-theme="light"] .bo-ticker { background: var(--bo-green); }

/* ── PROGNOSE / FORECAST STRIP ── */
.bo-fc-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
@media (max-width: 700px) { .bo-fc-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 460px) { .bo-fc-strip { grid-template-columns: repeat(3, 1fr); } }
.bo-fc-day {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r);
  padding: 11px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
}
.bo-shell:not(.bo-loaded) .bo-fc-day { opacity: 0; }
.bo-shell.bo-loaded .bo-fc-day {
  animation: boFadeUp .45s cubic-bezier(0.16,1,0.3,1) forwards;
}
.bo-shell.bo-loaded .bo-fc-day:nth-child(1) { animation-delay: .04s; }
.bo-shell.bo-loaded .bo-fc-day:nth-child(2) { animation-delay: .09s; }
.bo-shell.bo-loaded .bo-fc-day:nth-child(3) { animation-delay: .14s; }
.bo-shell.bo-loaded .bo-fc-day:nth-child(4) { animation-delay: .19s; }
.bo-shell.bo-loaded .bo-fc-day:nth-child(5) { animation-delay: .24s; }
.bo-shell.bo-loaded .bo-fc-day:nth-child(6) { animation-delay: .29s; }
.bo-shell.bo-loaded .bo-fc-day:nth-child(7) { animation-delay: .34s; }
.bo-fc-day:hover,
.bo-fc-day.today { border-color: var(--bo-green); background: var(--bo-green-bg); }
.bo-fc-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--bo-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.bo-fc-num {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -.04em;
}
.bo-fc-sub { font-size: 10px; color: var(--bo-faint); margin-top: 3px; }
.bo-fc-bar {
  height: 3px;
  background: var(--bo-surface2);
  border-radius: 2px;
  margin-top: 7px;
  overflow: hidden;
}
.bo-fc-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--bo-green-b);
  width: 0;
  transition: width 1s ease;
}

/* ── LEAFLET POPUP ── */
.leaflet-popup-content-wrapper {
  border-radius: var(--bo-r-lg) !important;
  box-shadow: var(--bo-shadow-lg) !important;
  border: 1px solid var(--bo-border);
  font-family: system-ui, sans-serif;
}
.leaflet-popup-content { margin: 0 !important; font-size: 13px; }
.leaflet-popup-tip-container { display: none; }

/* ── KAART POPUP ── */
.bo-popup {
  min-width: 220px;
  padding: 14px 16px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
}
.bo-popup-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.bo-popup-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--bo-text);
}
.bo-popup-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .03em;
}
.bo-popup-badge--open { background: var(--bo-green-bg); color: var(--bo-green); border: 1px solid var(--bo-green-b); }
.bo-popup-badge--plan { background: #eaeff8; color: #1a3f7a; border: 1px solid #b0c4e8; }
.bo-popup-badge--mnt  { background: #fdf4e0; color: #8a5c00; border: 1px solid #f0d080; }
.bo-popup-badge--cls  { background: var(--bo-surface2); color: var(--bo-muted); border: 1px solid var(--bo-border); }
.bo-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px solid var(--bo-border);
  font-size: 12px;
}
.bo-popup-row:last-of-type { border-bottom: none; }
.bo-popup-key { color: var(--bo-muted); flex-shrink: 0; }
.bo-popup-val { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: var(--bo-text); }
.bo-popup-sig--urgent  { color: #c0392b; font-weight: 500; font-size: 12px; }
.bo-popup-sig--warning { color: #d97706; font-weight: 500; font-size: 12px; }
.bo-popup-sig--ok      { color: var(--bo-green); font-weight: 500; font-size: 12px; }
.bo-popup-alarm {
  margin-top: 7px;
  font-size: 11px;
  background: #fde8e7;
  border: 1px solid #f0b0b0;
  border-radius: 4px;
  padding: 4px 9px;
  color: #c0392b;
}
.bo-popup-link {
  font-size: 11px;
  color: #ec0000;
  text-decoration: none;
  font-weight: 600;
}
.bo-popup-link:hover { text-decoration: underline; }
[data-theme="dark"] .bo-popup-link { color: #ff5555; }
[data-theme="dark"] .
body.dark .leaflet-popup-content-wrapper {
  background: var(--bo-surface) !important;
  color: var(--bo-text) !important;
}
[data-theme="dark"] .bo-popup-alarm,
body.dark .bo-popup-alarm { background: #2a0f0e; border-color: #5a1a1a; }
[data-theme="dark"] .bo-popup-badge--plan,
body.dark .bo-popup-badge--plan { background: #0a0f1a; color: #7a9fd4; border-color: #142040; }
[data-theme="dark"] .bo-popup-badge--mnt,
body.dark .bo-popup-badge--mnt { background: #1a1200; color: #c8a020; border-color: #3a2800; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .bo-header-inner          { padding: 0 12px; }
  .bo-header-right          { gap: 6px; }
  .bo-clk                   { display: none; }
  .bo-live-pill             { padding: 3px 7px; }
  .bo-wrap                  { padding: 12px 12px 40px; }
  .bo-wrap.bo-wrap--map     { padding: 8px 12px 12px; }
  .bo-region-bar            { padding: 0 12px; }
  .bo-modal-stats           { grid-template-columns: 1fr 1fr; }
  .bo-map-container         { height: calc(100vh - 200px); min-height: 320px; }
  .bo-map-sidebar           { max-height: none; position: static; }
}

/* ── HOUR CHART (mini bar) ── */
.bo-hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100px;
  width: 100%;
}
.bo-hour-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 2px;
}
.bo-hour-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height .6s cubic-bezier(.4,0,.2,1);
}
.bo-hour-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--bo-faint);
  white-space: nowrap;
}

/* ── STATUS DONUT LEGEND ── */
.bo-donut-legend { display: flex; flex-direction: column; }
.bo-donut-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}
.bo-donut-color { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }

/* ── TREND CHART (30 days) ── */
.bo-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  width: 100%;
}
.bo-trend-bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.bo-trend-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height .6s cubic-bezier(.4,0,.2,1);
}

/* ── WEEK CHART ── */
.bo-week-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  width: 100%;
}
.bo-week-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 4px;
}
.bo-week-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height .6s cubic-bezier(.4,0,.2,1);
}
.bo-week-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--bo-muted);
}

/* ── HEATMAP (uur × dag) ── */
.bo-hm-grid {
  display: grid;
  grid-template-columns: 28px repeat(24, 1fr);
  gap: 2px;
  min-width: 600px;
}
.bo-hm-day-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--bo-faint);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
}
.bo-hm-hr-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--bo-faint);
  text-align: center;
}
.bo-hm-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  cursor: pointer;
  transition: transform .12s;
}
.bo-hm-cell:hover { transform: scale(1.6); z-index: 5; position: relative; }
