/* Bootstrap zet display:block via JS-inline-style bij modal tonen.
   Bij server-side PRG-heropening (PHP) wordt .show class al gezet —
   deze regel vervangt de inline style en voorkomt CSP-blokkering. */
.modal.show { display: block; }

/* Geometrie-iconen in render_tabel — vervangt inline style="color:#1e90ff" */
.geo-icon { color: #1e90ff; }

#mapOverlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #fff;
}

.geometry-map-canvas {
  width: 100vw;
  height: 100vh;
}

.geometry-map-actions {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1001;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Energieflow builder ─────────────────────────────────────────────────── */
/* --kae-navbar-height wordt door menu.js op elke pagina ingesteld.
   Energieflow builder hergebruikt dezelfde variabele. */

.energy-builder-shell {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(260px, 340px);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.energy-builder-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--kae-navbar-height, 56px));
  min-height: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}

.energy-builder-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.energy-builder-sidebar,
.energy-builder-main,
.energy-builder-detail {
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
  min-height: 0;
}

.energy-builder-sidebar,
.energy-builder-detail {
  overflow: auto;
}

.energy-builder-main {
  display: flex;
  flex-direction: column;
  overflow: auto;
  height: 100%;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.energy-builder-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  padding-bottom: 8px;
}

.energy-flow-board {
  display: grid;
  gap: 14px;
  flex: 0 0 auto;
  overflow: visible;
  height: auto;
  min-height: 0;
  padding-right: 4px;
  align-content: start;
}

.energy-flow-section {
  border: 1px solid #d8dee4;
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfd;
}

.energy-flow-section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #d8dee4;
  background: #f2f5f8;
}

.energy-step-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.energy-step {
  border: 1px solid #cfd7df;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.energy-step.is-selected {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.14);
}

.energy-step-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.energy-step-title { font-weight: 700; }

.energy-step-meta {
  color: #5f6b76;
  font-size: 0.875rem;
}

.energy-stream-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.energy-stream-box {
  border: 1px solid #e1e6eb;
  border-radius: 6px;
  padding: 10px;
  background: #fcfcfd;
}

.energy-stream-heading {
  font-size: 0.78rem;
  color: #5f6b76;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.energy-stream {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #d8dee4;
  border-radius: 6px;
  background: #fff;
  padding: 7px 8px;
  margin-top: 6px;
  color: #1f2933;
}

.energy-stream:hover { border-color: #0d6efd; }

.energy-stream.is-open {
  border-color: #b76e00;
  background: #fff8e8;
}

.energy-stream-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.energy-stream-link {
  color: #5f6b76;
  font-size: 0.8rem;
  margin-top: 3px;
}

.energy-warning {
  border-left: 3px solid #b76e00;
  background: #fff8e8;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.875rem;
}

@media (max-width: 1100px) {
  .energy-builder-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: auto;
  }
}

/* bijv. in main.css */
.form-dirty .modal-header {
  border-bottom: 3px solid #ffc107;
}


/* Achtergrond */
.bg-app-green {
  background-color: #76B72A !important;
}

/* Body als flex-kolom zodat main exact de resterende viewport vult —
   geen JS of CSS-variabele nodig voor de navbar-hoogte. */
body.bg-app-green {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: 0;
}

/* Main groeit tot de resterende ruimte na de navbar. */
main.bg-app-green {
  flex: 1 0 auto;
  padding-top: 0;
  padding-bottom: 2rem;
}

/* Navbar en submenu's */
.kae-navbar {
  top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar * {
  position: relative;
  z-index: 1000 !important;
  pointer-events: auto !important;
  /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); */
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu>.dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -0.25rem;
  margin-left: 0.1rem;
}

.dropdown-submenu>a::after {
  content: "▸";
  float: right;
}

/* Graph container */
.energy-graph-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--energy-graph-nav-height, 0px));
  min-height: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}

.energy-graph-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.energy-graph-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.graph-view {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  min-height: 360px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

#network {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 0.5rem;
  z-index: 1;
}

.password-meter {
  height: .5rem;
  width: 0%;
}

/* ===== Utility: tekst opmaak ===== */
.text-prewrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.text-break-all {
  word-break: break-all;
}

/* ===== Utility: scrollbare containers ===== */
.pre-scrollable-sm {
  max-height: 300px;
  overflow: auto;
}

.pre-scrollable-lg {
  max-height: 32rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.scrollable-20 {
  max-height: 20rem;
  overflow-y: auto;
}

/* ===== Utility: cursor ===== */
.cursor-help {
  cursor: help;
}

/* ===== Utility: avatar cirkel navbar ===== */
.avatar-circle {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, .1);
}

/* ===== Utility: vierkante icoknop ===== */
.btn-icon-md {
  width: 2.25rem;
  height: 2.25rem;
}

/* ===== Utility: formulier max-breedte ===== */
.mw-form-sm  { max-width: 400px; }
.mw-form-md  { max-width: 440px; }
.mw-card-md  { max-width: 600px; }

/* ===== Utility: vaste kolombreedte ===== */
.col-w-130 { width: 130px; }

/* ===== Kaartcontainer ===== */
.geometry-map-page {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100dvh - var(--kae-navbar-height, 80px));
  overflow: hidden;
  background: #cfe7f1;
}

.map-fullpage {
  height: 100%;
  width: 100%;
}

/* ===== Autocomplete suggestiebox ===== */
.suggestion-dropdown {
  display: none;
  position: absolute;
  z-index: 9999;
  max-height: 300px;
  overflow-y: auto;
}

/* ===== Bulk tabel kolombreedtes ===== */
.bulk-col-meter    { width: 24%; }
.bulk-col-prev     { width: 14%; }
.bulk-col-value    { width: 18%; }
.bulk-col-datetime { width: 20%; }

#toolbar {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#mapOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1056;
  /* boven de modal */
  background: #fff;
}

.disclaimer-text {
    white-space: pre-wrap;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.table th,
.table td {
  vertical-align: middle;
}

.table th.text-center input {
  margin: 0;
}

.table-new-indicator {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: #e8f4d9;
  color: #3d6b12;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  vertical-align: middle;
}

/* ===== Rechtenmatrix layout ===== */

.rechten-matrix {
  table-layout: fixed;
}

.rechten-matrix th:nth-child(1),
.rechten-matrix td:nth-child(1) {
  width: 60%;
}

.rechten-matrix th:nth-child(2),
.rechten-matrix td:nth-child(2),
.rechten-matrix th:nth-child(3),
.rechten-matrix td:nth-child(3) {
  width: 20%;
  text-align: center;
}

.rechten-matrix input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
}

.rechten-matrix thead .small {
  line-height: 1.1;
}

.rechten-matrix-filter-select {
  max-width: 320px;
}

.readonly-field {
  background-color: #f5f5f5 !important;
  color: #555;
  cursor: not-allowed;
}
.readonly-field:focus {
  box-shadow: none;
}

.api-key-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.68);
  user-select: text;
}

.api-key-overlay__panel {
  width: min(42rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.35);
  padding: 1.25rem;
}

.api-key-overlay__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.api-key-overlay__notice {
  margin-bottom: 0.75rem;
  color: #8a5a00;
}

.api-key-overlay__text {
  width: 100%;
  min-height: 7rem;
  max-height: 18rem;
  overflow: auto;
  margin: 0;
  padding: 0.85rem;
  border: 1px solid #9ca3af;
  border-radius: 6px;
  background: #f9fafb;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
}

.api-key-overlay__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-readable-tooltip .tooltip-inner {
  text-align: left !important;
  line-height: 1.45;
  white-space: normal;
  width: max-content;
  max-width: min(42rem, calc(100vw - 2rem));
}

.modal-force-open {
  display: block;
}

@media (max-width: 768px) {
  .modal-readable-tooltip .tooltip-inner {
    max-width: calc(100vw - 1.5rem);
  }
}

/* ── Help offcanvas ──────────────────────────────────────────────────────── */
.help-doc-content h1,
.help-doc-content h2,
.help-doc-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.help-doc-content h1:first-child,
.help-doc-content h2:first-child,
.help-doc-content h3:first-child {
  margin-top: 0;
}

.help-doc-content p,
.help-doc-content ul,
.help-doc-content pre {
  margin-bottom: 1rem;
}

.help-doc-content pre {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}

.help-doc-content h4 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.help-doc-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}

.help-doc-meta {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e9ecef;
  color: #6c757d;
  font-size: 0.875rem;
}

.help-doc-meta-warning {
  margin-bottom: 0.5rem;
  color: #8a6d1d;
}

.help-doc-meta-details summary {
  cursor: pointer;
  color: #495057;
  user-select: none;
}

.help-doc-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-top: 0.5rem;
}

.help-doc-meta-item {
  color: #6c757d;
  white-space: nowrap;
}

.help-doc-meta-minimal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.help-doc-breadcrumb {
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.3;
}

.help-doc-menu-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.help-doc-menu-group {
  min-width: 0;
}

.help-doc-menu-list {
  padding-left: 1.1rem;
  margin-bottom: 0.75rem;
}

.help-doc-menu-list li {
  margin-bottom: 0.25rem;
}

.help-doc-screen-link {
  margin-left: 0.35rem;
  color: #6c757d;
  font-size: 0.85rem;
  white-space: nowrap;
}

.offcanvas .help-doc-content h1,
.offcanvas .help-doc-content h2,
.offcanvas .help-doc-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.offcanvas .help-doc-content h1:first-child,
.offcanvas .help-doc-content h2:first-child,
.offcanvas .help-doc-content h3:first-child {
  margin-top: 0;
}

.offcanvas .help-doc-content p,
.offcanvas .help-doc-content ul,
.offcanvas .help-doc-content pre {
  margin-bottom: 1rem;
}

.offcanvas .help-doc-content pre {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}

.offcanvas .help-doc-content h4 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.offcanvas .help-doc-menu-list {
  padding-left: 1.1rem;
  margin-bottom: 0.75rem;
}

.offcanvas .help-doc-menu-list li {
  margin-bottom: 0.25rem;
}

.offcanvas .help-doc-screen-link {
  margin-left: 0.35rem;
  color: #6c757d;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Meetwaarde grafiek */
.mw-filter-label {
  min-height: calc(1.5em + 0.75rem + 2px);
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.mw-filter-label__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 400;
}

.mw-filter-label__divider {
  color: #adb5bd;
}

/* EDX processing progress widths */
.edx-processing-bar {
  width: 0%;
}

.edx-progress-width-0 { width: 0%; }
.edx-progress-width-1 { width: 1%; }
.edx-progress-width-2 { width: 2%; }
.edx-progress-width-3 { width: 3%; }
.edx-progress-width-4 { width: 4%; }
.edx-progress-width-5 { width: 5%; }
.edx-progress-width-6 { width: 6%; }
.edx-progress-width-7 { width: 7%; }
.edx-progress-width-8 { width: 8%; }
.edx-progress-width-9 { width: 9%; }
.edx-progress-width-10 { width: 10%; }
.edx-progress-width-11 { width: 11%; }
.edx-progress-width-12 { width: 12%; }
.edx-progress-width-13 { width: 13%; }
.edx-progress-width-14 { width: 14%; }
.edx-progress-width-15 { width: 15%; }
.edx-progress-width-16 { width: 16%; }
.edx-progress-width-17 { width: 17%; }
.edx-progress-width-18 { width: 18%; }
.edx-progress-width-19 { width: 19%; }
.edx-progress-width-20 { width: 20%; }
.edx-progress-width-21 { width: 21%; }
.edx-progress-width-22 { width: 22%; }
.edx-progress-width-23 { width: 23%; }
.edx-progress-width-24 { width: 24%; }
.edx-progress-width-25 { width: 25%; }
.edx-progress-width-26 { width: 26%; }
.edx-progress-width-27 { width: 27%; }
.edx-progress-width-28 { width: 28%; }
.edx-progress-width-29 { width: 29%; }
.edx-progress-width-30 { width: 30%; }
.edx-progress-width-31 { width: 31%; }
.edx-progress-width-32 { width: 32%; }
.edx-progress-width-33 { width: 33%; }
.edx-progress-width-34 { width: 34%; }
.edx-progress-width-35 { width: 35%; }
.edx-progress-width-36 { width: 36%; }
.edx-progress-width-37 { width: 37%; }
.edx-progress-width-38 { width: 38%; }
.edx-progress-width-39 { width: 39%; }
.edx-progress-width-40 { width: 40%; }
.edx-progress-width-41 { width: 41%; }
.edx-progress-width-42 { width: 42%; }
.edx-progress-width-43 { width: 43%; }
.edx-progress-width-44 { width: 44%; }
.edx-progress-width-45 { width: 45%; }
.edx-progress-width-46 { width: 46%; }
.edx-progress-width-47 { width: 47%; }
.edx-progress-width-48 { width: 48%; }
.edx-progress-width-49 { width: 49%; }
.edx-progress-width-50 { width: 50%; }
.edx-progress-width-51 { width: 51%; }
.edx-progress-width-52 { width: 52%; }
.edx-progress-width-53 { width: 53%; }
.edx-progress-width-54 { width: 54%; }
.edx-progress-width-55 { width: 55%; }
.edx-progress-width-56 { width: 56%; }
.edx-progress-width-57 { width: 57%; }
.edx-progress-width-58 { width: 58%; }
.edx-progress-width-59 { width: 59%; }
.edx-progress-width-60 { width: 60%; }
.edx-progress-width-61 { width: 61%; }
.edx-progress-width-62 { width: 62%; }
.edx-progress-width-63 { width: 63%; }
.edx-progress-width-64 { width: 64%; }
.edx-progress-width-65 { width: 65%; }
.edx-progress-width-66 { width: 66%; }
.edx-progress-width-67 { width: 67%; }
.edx-progress-width-68 { width: 68%; }
.edx-progress-width-69 { width: 69%; }
.edx-progress-width-70 { width: 70%; }
.edx-progress-width-71 { width: 71%; }
.edx-progress-width-72 { width: 72%; }
.edx-progress-width-73 { width: 73%; }
.edx-progress-width-74 { width: 74%; }
.edx-progress-width-75 { width: 75%; }
.edx-progress-width-76 { width: 76%; }
.edx-progress-width-77 { width: 77%; }
.edx-progress-width-78 { width: 78%; }
.edx-progress-width-79 { width: 79%; }
.edx-progress-width-80 { width: 80%; }
.edx-progress-width-81 { width: 81%; }
.edx-progress-width-82 { width: 82%; }
.edx-progress-width-83 { width: 83%; }
.edx-progress-width-84 { width: 84%; }
.edx-progress-width-85 { width: 85%; }
.edx-progress-width-86 { width: 86%; }
.edx-progress-width-87 { width: 87%; }
.edx-progress-width-88 { width: 88%; }
.edx-progress-width-89 { width: 89%; }
.edx-progress-width-90 { width: 90%; }
.edx-progress-width-91 { width: 91%; }
.edx-progress-width-92 { width: 92%; }
.edx-progress-width-93 { width: 93%; }
.edx-progress-width-94 { width: 94%; }
.edx-progress-width-95 { width: 95%; }
.edx-progress-width-96 { width: 96%; }
.edx-progress-width-97 { width: 97%; }
.edx-progress-width-98 { width: 98%; }
.edx-progress-width-99 { width: 99%; }
.edx-progress-width-100 { width: 100%; }
