/* Data en BI, ronde 9. Overschrijft de db-regels in oplossingen.css. */

/* ── Opening: het sterrenbeeld uitgewerkt. Fijne sterren met echte helderheidsverschillen, dunne lijnen
   die afstand houden tot de sterren, en een band van de melkweg schuin achter beeld en dashboard. ── */
.dbh-melkweg {
  position: absolute; z-index: 0; left: -42%; top: -46%; width: 190%; aspect-ratio: 2600 / 760;
  background: url(../../sfeer/v2/melkweg.webp) center / 100% 100% no-repeat; transform: rotate(-22deg); opacity: .5; pointer-events: none; user-select: none;
  -webkit-mask-image: radial-gradient(ellipse 46% 34% at 54% 50%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 46% 34% at 54% 50%, #000 25%, transparent 80%);
}
.db-hemel .zk__lijn { stroke: rgba(200, 206, 255, .5); stroke-width: .8; stroke-linecap: round; fill: none; vector-effect: non-scaling-stroke; }
.db-hemel .zk svg { overflow: visible; }

/* ── Schuif van export naar dashboard ── */
.dbs { overflow-x: clip; }
.dbs > .s-binnen { z-index: 1; }
.dbs__nevel {
  position: absolute; z-index: 0; left: 50%; top: -110px; bottom: 230px; width: min(1800px, 140vw); height: auto; max-width: none;
  margin-left: calc(min(1800px, 140vw) / -2); object-fit: cover; object-position: 50% 45%; opacity: .55;
  pointer-events: none; user-select: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 30%, transparent 92%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 30%, transparent 92%);
}
.dbs__kop { max-width: 820px; margin: 0 auto; text-align: center; }
.dbs__kop .s-kop2 { margin-inline: auto; max-width: 24ch; }
.dbs__kop .s-tekst { max-width: 34em; margin: 20px auto 0; font-size: 18px; line-height: 1.55; }
.dbs__fig { position: relative; margin: 48px 0 0; }
.dbs__fig > :not(.dbs__nevel) { position: relative; z-index: 1; }

.dbs__paneel {
  position: relative; display: grid; overflow: hidden; border-radius: var(--r);
  border: 1px solid rgba(163, 176, 202, .16); background: #070e24;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 60px 120px -50px rgba(0, 0, 0, .95), 0 0 80px -30px rgba(var(--laag), .35);
  touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none;
}
/* twee lagen over elkaar, elk met clip-path tot zijn kant van de greep; de hoogte van het paneel zet data-en-bi.js op de hoogste
   inhoud (zonder script: de min-height hieronder) */
.dbs__paneel { min-height: 560px; }
.dbs__laag { position: absolute; inset: 0; overflow: hidden; }
.dbs__laag--toen { z-index: 0; clip-path: inset(0 calc(100% - var(--p)) 0 0); background: linear-gradient(160deg, #0a1330, #060c20 70%); }
.dbs__laag--nu {
  z-index: 1; clip-path: inset(0 0 0 var(--p));
  background: radial-gradient(ellipse 70% 60% at 70% 30%, rgba(94, 151, 255, .14), transparent 70%),
              radial-gradient(ellipse 60% 60% at 30% 90%, rgba(123, 74, 226, .16), transparent 70%),
              linear-gradient(160deg, #0d1739, #070d24 70%);
}
.dbs__nu-binnen { height: 100%; box-sizing: border-box; padding: 26px 36px; }

/* het Excel-blad in de schuif: rondom dezelfde marge, de opmerking onder het blad met een lijn naar D5 */
.dbs .db-xl { --rij: 34px; padding: 26px 36px 104px; }
/* de opmerking staat links van de greep: rechtsboven de lijn naar het midden van D5 */
/* 18 px verder naar links dan het blad zelf: zo blijft de opmerking links van de beginstand van de greep */
.dbs .db-xl__notitie { left: calc(36px + 30px + (100% - 102px) * .516 - 232px); }
.dbs .db-xl__notitie::before { left: auto; right: 22px; }
.js .dbs .db-xl .db-xl__notitie { opacity: 1; transform: none; }
.js .dbs .db-xl .db-xl__achter { transform: rotate(-2.4deg); }
.js .dbs__fig:not(.is-in) .db-xl .db-xl__notitie { opacity: 0; transform: translateY(6px); }
.js .dbs__fig:not(.is-in) .db-xl .db-xl__achter { transform: none; }

/* het dashboard: zelfde maanden, zelfde cijfers, één model */
.dbs-bi { height: 100%; display: flex; flex-direction: column; }
.dbs-bi .s-scherm__balk { flex: none; min-height: 44px; }
.dbs-bi .s-scherm__balk .ms { color: var(--wit); }
.dbs-bi__ververs { display: inline-flex; align-items: center; gap: 8px; color: var(--tekst-3); white-space: nowrap; }
.dbs-bi__ververs i { width: 6px; height: 6px; border-radius: 50%; background: var(--ijs); box-shadow: 0 0 8px 1px rgba(171, 225, 246, .6); }
.dbs-bi__inhoud { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; padding: 18px; }
.dbs-bi__tegels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dbs-bi__tegel, .dbs-bi__vak {
  border: 1px solid rgba(163, 176, 202, .1); border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .008));
}
.dbs-bi__tegel { display: grid; align-content: center; gap: 6px; padding: 14px 16px; }
.dbs-bi__tegel--licht { border-color: rgba(var(--laag), .7); background: linear-gradient(180deg, rgba(var(--laag), .16), rgba(var(--laag), .05)); box-shadow: 0 0 28px -6px rgba(var(--laag), .55); }
.dbs-bi__waarde { font: 500 26px/1.05 var(--kop); letter-spacing: -.02em; color: var(--wit); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dbs-bi__sub { font-size: 13px; color: var(--tekst-3); white-space: nowrap; }
.dbs-bi__grafieken { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.dbs-bi__vak { min-height: 0; display: flex; flex-direction: column; padding: 14px 16px; }
.dbs-bi__rij { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.dbs-bi__legenda { display: flex; gap: 16px; font-size: 13px; color: var(--tekst-2); }
.dbs-bi__legenda span { display: inline-flex; align-items: center; gap: 8px; }
.dbs-bi__legenda svg { display: block; flex: none; width: 16px; height: 8px; border-radius: 2px; }
.dbs-bi__o { background: linear-gradient(180deg, #abe1f6, #5e97ff); box-shadow: 0 0 10px 0 rgba(94, 151, 255, .45); }
.dbs-bi__k { background: linear-gradient(180deg, rgb(150, 156, 255), rgba(123, 74, 226, .8)); opacity: .7; }
.dbs-bi__staven {
  flex: 1; min-height: 0; margin-top: 14px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; padding-bottom: 8px;
  background: linear-gradient(rgba(163, 176, 202, .08) 1px, transparent 1px) 0 0 / 100% 33.3% ;
}
.dbs-bi__maand { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 8px 3px; min-height: 0; }
.dbs-bi__maand i { align-self: end; height: calc(var(--h) * 100%); border-radius: 2px 2px 0 0; transform-origin: bottom; transition: transform 700ms cubic-bezier(.3, .7, .2, 1) 300ms; }
.dbs-bi__maand b { grid-column: 1 / -1; font-size: 13px; font-weight: 500; line-height: 1; color: var(--tekst-3); text-align: center; }
.dbs-bi__lijn { flex: 1; display: block; width: 100%; min-height: 60px; margin-top: 12px; overflow: visible; }
.dbs-bi__raster { fill: none; stroke: rgba(163, 176, 202, .1); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dbs-bi__vlak { fill: url(#db-verloop); opacity: .12; }
.dbs-bi__pad { fill: none; stroke: url(#db-verloop); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(150, 156, 255, .55)); }
.dbs-bi__as { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--tekst-3); }
.dbs-bi__as .is-hier { color: var(--wit); font-weight: 600; }
.dbs-bi__apr { margin-top: 8px; font-size: 13px; color: var(--tekst-2); }
.dbs-bi__bron { font-size: 13px; color: var(--tekst-3); }
.js .dbs__fig:not(.is-in) .dbs-bi__maand i { transform: scaleY(0); }

/* de greep: één dunne lichtlijn met een vierkante knop, het enige lichte punt in het paneel */
.dbs__greep { position: absolute; z-index: 2; inset: 0; transform: translateX(var(--p)); pointer-events: none; }
.dbs__greep::before {
  content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, rgba(171, 225, 246, .25), #abe1f6 30%, rgb(150, 156, 255) 70%, rgba(150, 156, 255, .25));
  box-shadow: 0 0 12px 1px rgba(94, 151, 255, .55);
}
.dbs__knop {
  position: absolute; left: -23px; top: 50%; width: 46px; height: 46px; margin-top: -23px;
  display: grid; place-items: center; border-radius: var(--r); color: #fff;
  border: 1px solid rgba(171, 225, 246, .8); background: linear-gradient(180deg, #1f3068, #0e1840);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 5px rgba(var(--laag), .14), 0 0 28px 2px rgba(94, 151, 255, .55), 0 14px 28px -10px #000;
  transition: transform 160ms var(--erin);
}
.dbs__knop svg { width: 20px; height: 12px; }
.dbs__paneel.is-sleep .dbs__knop { transform: scale(1.08); }
.dbs__paneel:has(.dbs__invoer:focus-visible) .dbs__knop { outline: 2px solid #abe1f6; outline-offset: 3px; }
.dbs__invoer { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }

.dbs__bijschrift { display: grid; grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); gap: 14px 0; margin-top: 24px; }
.dbs__bijschrift p { padding-right: 48px; font-size: 15px; line-height: 1.55; color: var(--tekst-2); text-wrap: pretty; }
.dbs__bijschrift p + p { padding: 0 0 0 28px; }
.dbs__bijschrift b { font-weight: 600; color: var(--wit); }
.dbs__bijschrift .dbs__noot { grid-column: 1; grid-row: 2; align-self: end; padding: 0; font-size: 13px; color: var(--tekst-3); }

/* hetzelfde cijfer op laptop, telefoon en in Teams: klein, gedempt, op één plank onder "Met een dashboard" */
.dbs-ov {
  grid-column: 2; grid-row: 2; display: grid; grid-template-columns: minmax(0, 46fr) minmax(76px, 14fr) minmax(0, 40fr);
  align-items: end; gap: 22px; margin: 6px 0 0 28px; padding-bottom: 2px;
}
.dbs-ov > span { display: block; min-width: 0; }
.dbs-ov__label { display: block; font-size: 12px; line-height: 1.25; color: var(--tekst-3); white-space: nowrap; }
.dbs-ov__waarde { display: block; margin-top: 3px; font: 500 15px/1.1 var(--kop); letter-spacing: -.01em; color: #dfe3ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dbs-ov__scherm { display: flex; flex-direction: column; border: 1px solid rgba(163, 176, 202, .16); background: linear-gradient(170deg, #111c40, #080f27 75%); }
.dbs-ov__laptop .dbs-ov__scherm { aspect-ratio: 16 / 10; padding: 10px 12px 13px; border-radius: 5px 5px 0 0; border-bottom: 0; }
.dbs-ov__lijn { flex: 1; display: block; width: 100%; min-height: 0; margin-top: 6px; overflow: visible; }
.dbs-ov__lijn path { fill: none; stroke: url(#db-verloop); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .8; }
.dbs-ov__voet { display: block; height: 6px; margin: 0 -7%; border-radius: 0 0 5px 5px; background: linear-gradient(180deg, #1c2a52, #0b1430); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 20px -10px #000; }
.dbs-ov__tel { position: relative; border-radius: 13px; border: 1px solid rgba(var(--laag), .3); background: linear-gradient(170deg, #111c40, #080f27 75%); box-shadow: inset 0 0 0 3px #0a1230, inset 0 0 0 4px rgba(163, 176, 202, .08); }
.dbs-ov__tel::before { content: ""; position: absolute; left: 50%; top: 7px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: rgba(163, 176, 202, .18); }
.dbs-ov__tel .dbs-ov__scherm { aspect-ratio: 9 / 16; padding: 18px 9px 9px; border: 0; background: none; }
.dbs-ov__tel .dbs-ov__label, .dbs-ov__teams .dbs-ov__label { white-space: normal; }
.dbs-ov__tel .dbs-ov__waarde { font-size: 13px; }
.dbs-ov__staven { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 2px; min-height: 0; margin-top: 8px; }
.dbs-ov__staven i { height: calc(var(--h) * 100%); border-radius: 1px 1px 0 0; background: linear-gradient(180deg, rgb(150, 156, 255), rgba(94, 151, 255, .45)); opacity: .75; }
.dbs-ov__teams { border: 1px solid rgba(163, 176, 202, .16); border-radius: 5px; background: linear-gradient(180deg, rgba(17, 28, 64, .9), rgba(8, 15, 39, .95)); }
.dbs-ov__kop { display: flex; align-items: center; gap: 8px; padding: 9px 12px 9px; border-bottom: 1px solid rgba(163, 176, 202, .1); font-size: 12px; color: var(--tekst-2); }
.dbs-ov__kop img { width: 16px; height: 16px; }
.dbs-ov__bericht { display: block; padding: 9px 12px 7px; }

/* ── Pijplijn met HEMA: het bewijs hangt onder het rapport, met een lijn ernaartoe ── */
.db-pijp { display: grid; grid-template-columns: minmax(0, 66.4fr) minmax(0, 33.6fr); grid-template-areas: "beeld beeld" "stappen hema"; }
.db-pijp__beeld { grid-area: beeld; }
.db-pijp__bijschrift { grid-area: stappen; grid-template-columns: minmax(0, 32fr) minmax(0, 36fr) minmax(0, 32fr); }
/* de namenkolom is zo breed als de langste naam (subgrid), zodat "Klanttevredenheid" nooit midden in het woord breekt */
.dbp-reeks { flex: 1; display: grid; grid-template-columns: max-content minmax(0, 1fr); align-content: center; gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.dbp-reeks li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; gap: 12px; font-size: 13px; color: var(--tekst-2); }
.dbp-reeks svg { display: block; width: 100%; height: 28px; overflow: visible; }
.dbp-reeks path { fill: none; stroke: url(#db-pijp-verloop); stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(94, 151, 255, .55)); }
.dbp-hema {
  grid-area: hema; position: relative; margin-top: 32px; padding: 22px 22px 20px;
  border: 1px solid rgba(var(--laag), .28); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(17, 29, 60, .9), rgba(8, 15, 35, .94) 70%);
}
/* de lijn van rapport naar bewijs: een eigen griditem, want de kaart snijdt af */
.db-pijp::after {
  content: ""; grid-area: hema; justify-self: center; align-self: start; position: relative; z-index: 2;
  width: 1px; height: 57px; margin-top: -25px; pointer-events: none;
  background: linear-gradient(180deg, rgb(150, 156, 255), rgba(171, 225, 246, .5));
  box-shadow: 0 0 6px rgba(94, 151, 255, .6);
}
.dbp-hema .s-citaat p { font-size: 20px; }
.db-punten .db-melkweg { bottom: auto; top: 240px; }
.dbp-hema__case { margin-top: 14px; font-size: 15px; line-height: 1.55; color: var(--tekst-3); text-wrap: pretty; }
.dbp-hema .tekstlink { margin-top: 12px; }

/* ── 1024 ── */
@media (max-width: 1100px) {
  .dbs .db-xl { padding: 20px 24px 100px; }
  .dbs .db-xl__notitie { left: calc(24px + 26px + (100% - 74px) * .479 - 194px); width: 210px; }
  /* één tab minder, zodat de tabs links van de beginstand van de greep blijven */
  .dbs .db-xl__tabs span:nth-child(4) { display: none; }
  .dbs__nu-binnen { padding: 20px 24px; }
  .dbs-bi__inhoud { padding: 14px; gap: 10px; }
  .dbs-bi__tegel { padding: 10px 12px; }
  .dbs-bi__waarde { font-size: 22px; }
  .dbs-bi__staven { gap: 10px; }
  .dbs-bi__apr { display: none; }
  .dbp-hema { margin-top: 24px; padding: 18px; }
  .db-pijp::after { height: 45px; margin-top: -21px; }
}

@media (max-width: 900px) {
  /* de lijnen zijn hier niet te zien, maar het verloop erin kleurt ook de lijntjes in het rapport: verbergen zonder display none */
  .db-pijp__lijnen { display: block; visibility: hidden; position: absolute; width: 0; height: 0; }
  .db-pijp { grid-template-columns: minmax(0, 1fr); grid-template-areas: "beeld" "stappen" "hema"; }
  .db-pijp__bijschrift { grid-template-columns: minmax(0, 1fr); }
  .db-pijp::after { display: none; }
  .dbs__bijschrift { grid-template-columns: minmax(0, 1fr); }
  .dbs__bijschrift p, .dbs__bijschrift p + p { padding: 0; }
  .dbs__bijschrift .dbs__noot { grid-row: auto; }
  .dbs-ov { grid-column: 1; grid-row: auto; margin: 10px 0 4px 14px; max-width: 520px; }
  .dbs-bi__tegels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dbs-bi__grafieken { grid-template-columns: minmax(0, 1fr); }
  .dbs-bi__vak--marge { display: none; }
}

@media (max-width: 560px) {
  .dbs__kop { text-align: left; }
  .dbs__kop .s-tekst { margin-left: 0; }
  .dbs__fig { margin-top: 32px; }
  .dbs .db-xl { padding: 16px 14px; }
  /* smal: de kop van de grafiek op twee regels en één tab minder, zodat de greep in de beginstand geen woord doorsnijdt */
  .dbs-bi__rij .db__label { max-width: 9em; }
  .dbs .db-xl__tabs span:nth-child(3) { display: none; }
  .dbs .db-xl__notitie { left: auto; width: auto; margin: 14px 46% 0 0; }
  .dbs .db-xl__notitie::before { display: none; }
  .dbs__nu-binnen { padding: 16px 14px; }
  .dbs-bi .s-scherm__balk { padding: 0 12px; }
  .dbs-bi__ververs { font-size: 12px; }
  .dbs-bi__inhoud { padding: 10px; gap: 8px; }
  .dbs-bi__tegels { gap: 8px; }
  .dbs-bi__tegel { padding: 10px; gap: 4px; }
  .dbs-bi__waarde { font-size: 19px; }
  .dbs-bi__sub { font-size: 12px; }
  .dbs-bi__vak { padding: 10px; }
  .dbs-bi__legenda { gap: 10px; font-size: 12px; }
  .dbs-bi__staven { gap: 6px; margin-top: 10px; }
  .dbs-bi__maand b { font-size: 12px; }
  .dbs-bi__bron { display: none; }
  .dbs-ov { gap: 14px; }
  /* smal: de knop zakt naar de band met staven en opmerking, waar hij geen cijfers of legenda afdekt */
  .dbs__knop { left: -21px; top: 82%; width: 42px; height: 42px; margin-top: -21px; }
  .dbh-melkweg { left: -60%; width: 220%; top: -30%; }
}

@media (prefers-reduced-motion: reduce) {
  .dbs__knop, .dbs-bi__maand i { transition: none; }
  .js .dbs__fig:not(.is-in) .dbs-bi__maand i { transform: none; }
  .js .dbs__fig:not(.is-in) .db-xl .db-xl__notitie { opacity: 1; transform: none; }
  .js .dbs__fig:not(.is-in) .db-xl .db-xl__achter { transform: rotate(-2.4deg); }
}
