/* ============================================================
   24x7 ICT Status — Huisstijl
   Groen (accent) · Antraciet/Zwart · Wit
   ============================================================ */

:root {
  --green:        #4CAF50;   /* 24x7 accent groen */
  --green-dark:   #3d8b40;
  --green-soft:   rgba(76, 175, 80, .12);
  --amber:        #f0ad4e;
  --amber-soft:   rgba(240, 173, 78, .14);
  --red:          #e0483d;
  --red-soft:     rgba(224, 72, 61, .12);
  --ink:          #1a1f24;   /* antraciet */
  --ink-2:        #232a31;
  --ink-3:        #2e363e;
  --line:         #e6e9ec;
  --line-dark:    #3a434c;
  --paper:        #f6f7f8;
  --white:        #ffffff;
  --muted:        #6b7680;
  --muted-dark:   #9aa5b0;
  --radius:       12px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-header {
  background: var(--ink);
  color: var(--white);
  padding: 26px 0 24px;
  border-bottom: 3px solid var(--green);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-header img.logo { max-height: 46px; width: auto; display: block; }
.site-header .titles h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.site-header .titles p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted-dark); }

/* ---- Globale banner ---- */
.overall {
  margin: 22px 0 8px;
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 14px;
  font-weight: 600; font-size: 16px;
  border: 1px solid var(--line);
  background: var(--white);
}
.overall .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.overall.ok    { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.overall.ok .dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.overall.warn  { border-color: var(--amber); background: var(--amber-soft); color: #a6741f; }
.overall.warn .dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.overall.down  { border-color: var(--red); background: var(--red-soft); color: #b13228; }
.overall.down .dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.overall .stamp { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--muted); font-family: var(--mono); }

/* ---- Onderhoudsbanner ---- */
.maint-banner {
  margin: 12px 0 6px; border-radius: var(--radius); padding: 14px 18px;
  border: 1px solid var(--line);
}
.maint-banner.active   { border-color: #3b82c4; border-left: 4px solid #3b82c4; background: rgba(59,130,196,.07); }
.maint-banner.upcoming { border-color: var(--line); border-left: 4px solid #9aa5b0; background: var(--white); }
.maint-banner .maint-title { margin: 0 0 10px; font-size: 13px; font-weight: 700;
  text-transform: none; letter-spacing: 0; }
.maint-banner.active .maint-title { color: #2c6ba3; }
.maint-banner.upcoming .maint-title { color: var(--muted); }
.maint-item { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 7px 0; border-top: 1px solid rgba(0,0,0,.06); }
.maint-item:first-of-type { border-top: none; }
.maint-name { font-weight: 600; }
.maint-detail { display: flex; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.maint-desc { color: var(--muted); font-family: var(--sans); }

/* ---- Maintenance-balk in tijdlijn ---- */
.uptime-strip .bar.maint { background: #7ba7d0; }

/* ---- Detail-tags ---- */
.day-detail .dd-tag { font-size: 10px; font-family: var(--mono); border-radius: 4px; padding: 1px 5px; }
.day-detail .dd-tag.maint { background: rgba(59,130,196,.15); color: #2c6ba3; }
.day-detail .dd-maint { color: #2c6ba3; }
.day-detail .dd-ongoing { font-size: 10px; font-family: var(--mono); color: #b13228;
  background: var(--red-soft); border-radius: 4px; padding: 1px 5px; }

/* ---- Actieve balk (aangeklikt) ---- */
.uptime-strip .bar.bar-active { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---- Actieve storing: kaart-markering + kop ---- */
.down-heading { color: #b13228 !important; }
.check.is-down {
  border-color: var(--red);
  border-left: 4px solid var(--red);
  background: linear-gradient(0deg, var(--white), var(--white)) padding-box,
              var(--red-soft);
}
.check.is-down { background: #fff; box-shadow: inset 3px 0 0 var(--red); }

/* ---- Klikbare tijdlijn ---- */
.uptime-strip .bar { cursor: pointer; }
.uptime-strip .bar.none { cursor: default; }

/* ---- Dag-detailpaneel ---- */
.day-detail { display: none; }
.day-detail.open {
  display: block;
  margin: 10px 0 4px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.day-detail .dd-head { font-size: 13px; margin-bottom: 6px; }
.day-detail .dd-loading { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.day-detail .dd-ok { color: var(--green-dark); }
.day-detail .dd-sub { color: var(--muted); margin: 4px 0 6px; }
.day-detail .dd-list { margin: 4px 0 0; padding-left: 4px; list-style: none; }
.day-detail .dd-list > li { padding: 4px 0; border-top: 1px dashed var(--line); }
.day-detail .dd-list > li:first-child { border-top: none; }
.day-detail .dd-sublist { margin: 4px 0 0 14px; padding-left: 10px; list-style: none;
  border-left: 2px solid var(--line); }
.day-detail .dd-sublist li { padding: 2px 0; }
.day-detail .dd-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.day-detail .dd-name { font-weight: 600; }
.day-detail .dd-pct { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.day-detail .dd-err { color: #b13228; }

/* ---- Gebundelde groep: onderdelen-lijst ---- */
.check.bundled .group-expand-toggle {
  margin-left: auto;
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-family: var(--sans);
  color: var(--green-dark); cursor: pointer;
}
.check.bundled .group-expand-toggle:hover { border-color: var(--green); background: var(--green-soft); }
.group-members { display: none; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.group-members.open { display: block; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.member-row:last-child { border-bottom: none; }
.member-state .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.member-state.up .dot { background: var(--green); }
.member-state.warning .dot { background: var(--amber); }
.member-state.down .dot { background: var(--red); }
.member-state.pending .dot { background: var(--muted); }
.member-state.maintenance .dot { background: #3b82c4; }
.member-name { font-weight: 600; }
.member-type { font-family: var(--mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; text-transform: uppercase; }
.member-pct { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.member-err { color: #b13228; font-family: var(--mono); font-size: 11.5px; flex-basis: 100%; padding-left: 19px; }

/* ---- Groep ---- */
.group { margin-top: 26px; }
.group h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 0 0 10px; font-weight: 700;
}

/* ---- Check kaart ---- */
.check {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}
.check .row { display: flex; align-items: center; gap: 12px; }
.check .name { font-weight: 600; font-size: 15px; }
.check .type-badge {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  color: var(--muted); background: var(--paper);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; text-transform: uppercase;
}
.check .state {
  margin-left: auto; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px;
}
.check .state .dot { width: 9px; height: 9px; border-radius: 50%; }
.state.up    { color: var(--green-dark); }
.state.up .dot { background: var(--green); }
.state.warning { color: #a6741f; }
.state.warning .dot { background: var(--amber); }
.state.down  { color: #b13228; }
.state.down .dot { background: var(--red); }
.state.pending { color: var(--muted); }
.state.pending .dot { background: var(--muted); }
.state.maintenance { color: #2c6ba3; }
.state.maintenance .dot { background: #3b82c4; }

/* ---- 90-dagen uptime strip (signature) ---- */
.uptime-strip {
  display: flex; gap: 2px; margin: 14px 0 8px; height: 34px; align-items: stretch;
}
.uptime-strip .bar {
  flex: 1 1 0; border-radius: 2px; min-width: 2px;
  background: var(--line);
  transition: transform .08s ease;
}
.uptime-strip .bar.up   { background: var(--green); }
.uptime-strip .bar.warn { background: var(--amber); }
.uptime-strip .bar.down { background: var(--red); }
.uptime-strip .bar.none { background: #dfe3e6; }
.uptime-strip .bar:hover { transform: scaleY(1.12); }

.strip-legend {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.strip-legend .pct { color: var(--green-dark); font-weight: 600; }

/* ---- Meta regel ---- */
.check .meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.check .meta b { color: var(--ink); font-weight: 600; }

/* ---- Sparkline (legacy, nog gebruikt in SVG-helper) ---- */
.spark { display: block; width: 100%; height: 40px; margin-top: 6px; }

/* ---- Interactieve responstijd-grafiek ---- */
.rt-chart { margin-top: 8px; }
.rt-wrap { display: flex; gap: 8px; align-items: stretch; }
.rt-axis {
  position: relative; width: 30px; flex: 0 0 30px; height: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--mono); font-size: 9.5px; color: var(--muted);
  text-align: right; padding-right: 2px; border-right: 1px solid var(--line);
}
.rt-axis .rt-unit { position: absolute; top: -12px; right: 0; font-size: 8.5px; color: var(--muted-dark); }
.rt-plot { position: relative; flex: 1 1 auto; height: 48px; }
.rt-svg { width: 100%; height: 100%; display: block; }
.rt-hit { position: absolute; inset: 0; }
.rt-cursor {
  position: absolute; top: 0; bottom: 0; width: 1px; background: var(--green-dark);
  display: none; transform: translateX(-0.5px); pointer-events: none;
}
.rt-tip {
  position: absolute; top: 2px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-family: var(--mono); font-size: 10.5px;
  padding: 4px 7px; border-radius: 5px; white-space: nowrap; display: none;
  pointer-events: none; line-height: 1.35; z-index: 3;
}
.rt-tip.flip { transform: translateX(-100%); }
.rt-tip b { color: #7bd88a; }

/* ---- Footer ---- */
.site-footer {
  margin: 40px 0 30px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); text-align: center;
}
.site-footer a { color: var(--muted); text-decoration: underline; }

/* ---- Responsief ---- */
@media (max-width: 560px) {
  .check .meta { gap: 10px; }
  .overall { flex-wrap: wrap; }
  .overall .stamp { margin-left: 0; width: 100%; }
  .uptime-strip { height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .uptime-strip .bar { transition: none; }
}
