/* styles.css — Version v172a 2026-03-15 17:00
*/

/* ==================== DESIGN TOKENS ==================== */
:root {
  /* Typography */
  --font-main: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;

  /* Modern surfaces */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;

  /* Text & borders */
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;

  /* Brand */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #f59e0b;
  --accent-hover: #d97706;

  /* Effects */
  --radius: 12px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 12px 30px rgba(17, 24, 39, 0.10);
  --ring: 0 0 0 4px rgba(37, 99, 235, 0.18);

  /* Legacy token names used throughout the app (mapped) */
  --color-blue: var(--primary);
  --color-orange: var(--accent);
  --color-hover-blue: var(--primary-hover);
  --color-hover-orange: var(--accent-hover);
  --color-helper-text: var(--muted);
  --color-border: var(--border);
  --color-bg-light: var(--surface-2);

  /* Existing app/layout tokens kept */
  --chart-ph-color: var(--muted);
  --chart-ph-indent: 0px;
  --result-col-max: 34rem;
  /* Minimum width for each results column card (tune if you want) */
  --results-col-min: 420px;

  /* File-button tokens */
  --filebtn-bg: var(--surface);
  --filebtn-fg: var(--text);
  --filebtn-bd: var(--border);
  --filebtn-radius: 10px;
  --filebtn-pad: 8px 12px;

  /* Form layout */
  --label-col: 450px;
  --analysis-btn-width: 560px;
  --field-col: 220px;
}


/* ==================== BASE ==================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
@font-face {
  font-family: System;
  src: local("Arial"); /* of laat deze blok weg als je geen custom webfont gebruikt */
  font-display: swap;
}
html {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 125%;
}

input,
select,
textarea,
button {
  font-size: 0.8rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  /* Prevent page-level horizontal scrolling; horizontal scroll should happen inside dedicated containers */
  overflow-x: hidden;
}

h3,
h4,
h5,
label,
p,
.key,
.value {
  font-family: var(--font-main), Arial, sans-serif;
  margin: 0 0 1px;
}

ul {
  padding: 0;
  margin-top: 0;
}

h2 {
  margin-bottom: 0.1em;
}

/* ==================== LAYOUT ==================== */
.page{max-width:1600px;margin:0 auto;padding:18px 16px 110px;}
.columns {
  display: flex;
}

.column {
  flex: 1;
  padding: 10px;
}

.two-column-wrapper {
  display: flex;
  justify-content: start;
  gap: 10px;
  margin: 10px 0;
}

.column ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.column li {
  margin-bottom: 5px;
}

.buttons-wrapper {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.pvgis-grid {
  /* Robust two-column layout: form on the left, map on the right.
     Uses CSS grid to avoid any overlap on intermediate widths. */
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(340px, 520px);
  gap: 1rem;
  align-items: start;
}

.pvgis-left {
  min-width: 0; /* allow inner fields to shrink without pushing overlap */
  position: relative;
  z-index: 2;
}

.pvgis-right {
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* PVGIS address row: put buttons on a new line under the address input */
.pvgis-left .form-group:has(#geo_address) {
  flex-wrap: wrap;
  align-items: flex-start;
}

.pvgis-left .form-group:has(#geo_address) > label {
  /* keep the label column behaviour */
  flex: 0 0 var(--label-col);
}

.pvgis-left .form-group:has(#geo_address) > #geo_address {
  flex: 1 1 520px;
  width: min(520px, 100%) !important; /* override inline width:360px */
  max-width: 520px;
}

/* Move buttons to the next line, directly under the input */
.pvgis-left .form-group:has(#geo_address) > #btnGeocode,
.pvgis-left .form-group:has(#geo_address) > #btnGeolocate {
  flex: 0 0 auto;
  margin-left: calc(var(--label-col) + 10px); /* aligns buttons under the input */
}

.pvgis-left .form-group:has(#geo_address) > #btnGeolocate {
  margin-left: 8px; /* spacing between the two buttons */
}

/* Status text goes on a new line below buttons (optional) */
.pvgis-left .form-group:has(#geo_address) > #geo_status {
  flex: 1 1 100%;
  margin-left: calc(var(--label-col) + 10px) !important;
  margin-top: 6px;
}

/* ==================== TABLES ==================== */
.cashflow-table-wrap{
  /* Scroll both directions when expanded (cashflow table can be huge) */
  overflow: auto;
  max-height: 80vh;
  border: 1px solid rgba(229,231,235,.85);
  border-radius: var(--radius);
  background: var(--surface);
}


.cashflow-details{
  margin-top: .25rem;
}

.cashflow-details > summary{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .25rem 0;
  user-select: none;
}

.cashflow-details > summary::-webkit-details-marker{ display:none; }

.cashflow-details > summary::before{
  content: "▸";
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  transform: translateY(1px);
}

.cashflow-details[open] > summary::before{
  content: "▾";
}

.cashflow-title{
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.cashflow-subtitle{
  color: var(--muted);
  font-size: .9rem;
}


.table{
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}

.table th,
.table td{
  border-bottom: 1px solid rgba(229,231,235,.7);
  padding: 8px 10px;
  vertical-align: top;
}

.table th{
  text-align: left;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table.table-striped td:not(:first-child) {
  text-align: right;
}

/* ==================== FORMS ==================== */
.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  gap: 10px;
  flex-wrap: nowrap;
}

.form-group input,
.form-group select {
  width: 80px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.06);
  margin: 0;
}

.form-group option {
  text-align: right;
}

.helper-text {
  font-size: 0.9em;
  color: var(--color-helper-text);
  flex-grow: 1;
}

input[type="text"] {
  width: 8em;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.06);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form-group input[name^="pvgis_tilt_"],
.form-group input[name^="pvgis_az_"] {
  width: 70px;
}

#profileset {
  width: 220px;
}

#kwh_year_user {
  width: 125px;
}

#param_preset {
  width: 220px;
}

.filelike-button {
  background: var(--filebtn-bg);
  color: var(--filebtn-fg);
  border: 1px solid var(--filebtn-bd);
  border-radius: var(--filebtn-radius);
  padding: var(--filebtn-pad);
  font: inherit;
  cursor: pointer;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .05s ease;
}

.form-group--mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 8px 0;
}

.form-group--mini select {
  min-width: 160px;
  padding: 6px 8px;
}

.speed-row-left {
  display: block;
  width: 100%;
  text-align: left;
}

.speed-row-left .form-group--mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.speed-row-left .form-group--mini label {
  width: auto;
  min-width: 0;
  max-width: none;
  text-align: left;
  margin-right: 8px;
}

.speed-row-left .form-group--mini select {
  min-width: 160px;
  padding: 6px 8px;
  text-align: left;
}

.action-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-group > label {
  flex: 0 0 var(--label-col);
  width: var(--label-col);
  max-width: var(--label-col);
  min-width: var(--label-col);
  text-align: right;
  font-weight: 650;
  color: var(--muted);
  padding-right: 10px;
}

.form-group .helper-text {
  flex: 1 1 auto;
}

.feedback-inline {
  margin: 6px 0 14px;
  text-align: left;
}

.file-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-input-row .file-name {
  flex: 1 1 320px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  line-height: 1.2;
}

.file-input-row .helper-inline {
  flex-basis: 100%;
  margin-top: 6px;
}

.simple-form .form-group label {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  text-align: right;
  margin-right: 10px;
}

.simple-form .form-group input {
  width: 120px;
  text-align: right;
}

#tab-analysis .form-group input,
#tab-analysis .form-group select {
  width: 100px;
  text-align: right;
}

#tab-analysis .blue-button small,
#tab-analysis .blue-button .subtext,
#tab-analysis .blue-button .helper-text,
#tab-analysis .blue-button .helper-inline {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 2px;
}

#tab-analysis .button-row,
#tab-analysis .form-group .button-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.simulation-type-section .helper-text {
  margin: 0 0 4px 0;
}

.helper-text-small {
  font-size: 0.9em;
  color: var(--color-helper-text);
  flex-grow: 1;
}

#dynamic-tariff-section {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  background-color: #f9f9f9;
}

.dyn-coef-formula {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.dyn-coef-formula .formula-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.dyn-coef-formula .formula-label {
  font-weight: 600;
  margin-right: 4px;
}

.dyn-coef-formula .formula-eq {
  white-space: nowrap;
}

.dyn-coef-formula input[type="number"] {
  width: 80px;
  font-size: 0.9em;
  text-align: right;
}

#dynamic-tariff-section input[type="number"]::-webkit-inner-spin-button,
#dynamic-tariff-section input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#dynamic-tariff-section input[type="number"] {
  -moz-appearance: textfield;
}

.helper-text.helper-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: help;

  flex: 0 0 auto;
  position: relative;
  flex-grow: 0;
}

.helper-text.helper-icon::after {
  content: attr(data-help);
  position: absolute;
  top: 120%;
  left: 0;
  min-width: min(500px, 85vw);  /* responsive tooltip width */
  max-width: min(600px, 92vw);
  padding: 8px 10px;
  background: rgba(100, 100, 100,0.8);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  white-space: normal;
  text-align: left;
  text-indent: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 9999;
}

.helper-text.helper-icon:hover::after,
.helper-text.helper-icon:focus::after {
  opacity: 1;
  transform: translateY(0);
}

/* Bring the icon (and its tooltip) above nearby panels like #pvmap */
.helper-text.helper-icon:hover,
.helper-text.helper-icon:focus{
  z-index: 9998;
}

.helper-inline {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin-top: 0;
}

.recalc-btn-row {
  display: block;
  width: 100%;
  padding-left: calc(var(--label-col) + 10px);
}

#recalc-selected-profile-btn {
  width: var(--field-col);
  min-height: 40px;
  font-size: 0.8em;
}

/* ==================== TABS ==================== */
.tabs {
  display: flex;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#tab-analysis #kwh_year_user {
  width: 100px;
}

#tab-analysis .blue-button,
#tab-analysis .blue-button:visited {
  width: var(--analysis-btn-width);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center !important;
  align-items: center;
  text-align: center;
  white-space: normal;
  padding: 10px 12px;
}

#tab-analysis .blue-button > * {
  margin: 0;
  text-align: center;
  align-self: center;
}

/* ==================== BUTTONS ==================== */
.blue-buttons-container,
.orange-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.blue-button,
.orange-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.blue-button {
  background-color: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.blue-button:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.orange-button {
  background-color: var(--color-orange);
  color: black;
  transition: background-color 0.3s ease;
}

.orange-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ==================== TOOLTIPS ==================== */
.help-tip {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: help;
  opacity: 0.75;
  position: relative;

  flex: 0 0 auto;
  flex-grow: 0;
}

.help-tip::before {
  content: "?";
}

.help-tip:focus,
.help-tip:hover {
  opacity: 1;
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: 120%;
  left: 0;
  min-width: 220px;
  max-width: 360px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 10;
}

.help-tip:focus::after,
.help-tip:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== RESULTS LAYOUT ==================== */
/* Cards */
.results-section{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  margin: 8px 0;
  overflow-x: auto;
}

.results-section h2{
  margin: 4px 0 8px;
  font-size: 0.98rem;
  letter-spacing: .01em;
  line-height: 1.2;
}

.results-section h3{
  margin: 8px 0 6px;
  font-size: 0.92rem;
}
.muted{color:var(--muted);}

.results-before-pv,
.results-wp-pv {
  max-width: 500px;
  margin: auto;
}

/* Results: show calculation period above the cards (not inside a card) */
.period-info-banner{
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;

  margin: 0 0 12px 0;
  padding: 8px 10px;

  border: 1px solid var(--color-border);
  background: white;
  border-radius: 10px;

  color: var(--color-helper-text);
  font-size: 1rem;
}

/* Period banner: separator + meta text */
.period-info-sep{
  opacity: 0.55;
  padding: 0 2px;
}

.period-info-meta strong{
  font-weight: 600;
}

.period-info-label{
  font-weight: 600;
  color: #111; /* keep label readable */
}

/* Results rows: horizontal scrolling happens INSIDE the row (not on the page) */
.row-grid-2,
.row-grid-3,
.row-grid-4 {
  display: grid;
  gap: .2rem;
  align-items: start;

  width: 100%;
  max-width: 100%;
  min-width: 0;

  overflow-x: auto;
  overflow-y: visible;
  justify-content: start;
  padding-bottom: 2px;

  -webkit-overflow-scrolling: touch;
}

.row-grid-2 {
  grid-template-columns: repeat(2, 460px);
}

.row-grid-3 {
  grid-template-columns: repeat(3, 460px);
}

.row-grid-4 {
  grid-template-columns: repeat(4, 387px);
}

/* Cards should stretch to fill their grid column */
.row-grid-2 > .results-section,
.row-grid-3 > .results-section,
.row-grid-4 > .results-section {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.results-section .kv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem .75rem;
}

.results-section .kv-item {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: .2rem .45rem;
  align-items: center;
  padding: .42rem .52rem;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(17,24,39,.03);
  min-width: 0;
  font-size: 0.90rem;
}

.results-section .kv-key {
  text-align: left;
  font-weight: 650;
  color: var(--text);
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.18;
}

.results-section .kv-item > div:last-child {
  text-align: right;
  min-width: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.90rem;
}

.results-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  width: 100%;
  margin: 0 0 10px 0;
  padding: 7px 10px;
  box-sizing: border-box;
  background: #f7f7f7;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  line-height: 1.3;
  font-size: 0.96rem;
  text-align: left;
}

.results-summary-bar span {
  white-space: nowrap;
}

/* ==================== CHARTS & LOADING UI ==================== */
.chart-container{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  margin: 14px 0;
}
/* Hide chart cards when hidden attribute is present */
.chart-container[hidden] { display: none !important; }

/* Hide chart controls when hidden */
.chart-controls[hidden] { display: none !important; }

/* Avoid broken image icon when src is empty */
.chart-container img[src=""] { display: none !important; }

.chart{
  width: 100% !important;
  max-width: none;
  height: auto;
  display: block;
  border-radius: calc(var(--radius) - 2px);
  margin-left: auto;
  margin-right: auto;
}
/* Force full width even if index.html sets inline max-width on charts */
.chart[style],
img.chart[style]{
  width: 100% !important;
  max-width: none !important;
  height: auto;
}
/* Charts shown after orange buttons (these images don't have .chart class) */
#chartNPVper1kwp,
#chartNPVper1kwh,
#tableImage{
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
}

.chart-placeholder{
  color: var(--muted);
  background: linear-gradient(90deg, rgba(17,24,39,.04), rgba(17,24,39,.02), rgba(17,24,39,.04));
  border: 1px dashed rgba(17,24,39,.12);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.loading-message {
  display: none;
  text-align: center;
  font-size: 1rem;
  color: var(--muted);
  margin: 14px auto;
  width: min(900px, 95%);
  background-color: var(--surface);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.spinner-overlay[hidden] {
  display: none !important;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.20);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Allow clicking UI behind the overlay (used for Fluvius cache build) */
.spinner-overlay.nonblocking{
  pointer-events: none;
}

/* Make sure spinner box itself also doesn't capture clicks */
.spinner-overlay.nonblocking .spinner-box{
  pointer-events: none;
}

.spinner-overlay.nonblocking{
  background: rgba(17, 24, 39, 0.12);
  backdrop-filter: none;
}

.spinner-core {
  width: 44px;
  height: 44px;
  border: 4px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: graphs-spin 1s linear infinite;
}

.spinner-label {
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
}

.spinner-box{
  background: rgba(255,255,255,0.98);
  padding: 16px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.20);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.spinner-label{
  color: #0f172a; /* donker op witte box = leesbaar */
  text-align: center;
}

.chart-container {
  position: relative;
  min-height: 220px;
}

.chart-container img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 8px 12px 8px var(--chart-ph-indent);
  font-size: 0.95rem;
  opacity: 0.85;
  text-align: left;
  color: var(--chart-ph-color);
}

.chart-container.loading .chart-placeholder {
  display: flex;
}

.chart-container.loading img {
  opacity: 0.25;
  filter: blur(1px);
}

.chart-container:not(.loading) .chart-placeholder {
  display: none;
}

.chart-container.error .chart-placeholder {
  color: #b00020;
  font-weight: 600;
}

#rebuild-graphs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  white-space: nowrap;
  line-height: 1.2;
}

.graphs-hint {
  margin: 0;
  white-space: nowrap;
}

/* ==================== PVGIS / MAP ==================== */
.pvgis-map-row {
  grid-column: 1 / -1;
  display: block;
}

#pvmap {
  height: 260px;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  display: block;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#pvmap.leaflet-container {
  cursor: crosshair;
}

/* ==================== SIMULATION TYPE / PV CONFIG ==================== */
.simulation-type-section {
  margin: 0 0 12px 0;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fafafa;
}

.simulation-type-section h3 {
  margin: 0 0 4px 0;
  font-size: 1rem;
}

.simulation-type-list {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.simulation-type-list .simtype-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.simulation-type-list .simtype-option input[type="radio"]{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.pv-config-options {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  flex-direction: column;
}
.simulation-type-list .simtype-option:has(input[type="radio"]:checked){
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.25);
}


.pv-config-option input[type="radio"] {
  margin: 0 4px 0 0;
  width: auto;
  flex: 0 0 auto;
}

.pv-config-option{
  display: inline-flex;      /* keeps bullet and text aligned */
  align-items: center;
  gap: 10px;                 /* space between bullet, text and info icon */
  min-width: 0;
}

.pv-config-option input[type="radio"] {
  margin-top: 4px;      /* aligns bullet with first text line */
}

.pv-config-text {
  white-space: normal;   /* allow wrapping on narrower widths */
  min-width: 0;
}

/* ==================== COLLAPSIBLES ==================== */
.collapsible-legend {
  padding: 0 8px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text);
  cursor: pointer;          /* extra: maakt duidelijk dat het klikbaar is */
  user-select: none;
}

.collapsible-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  max-width: 1300px;
}

/* standaard OPEN */
.collapsible-fieldset .collapsible-body {
  display: block;
  margin-top: 10px;
}

/* enkel dicht als fieldset collapsed is */
.collapsible-fieldset.collapsed .collapsible-body {
  display: none;
}

.collapsible-legend h2 {
  color: var(--primary);
  margin: 0;
  line-height: 1.2;
}


/* ==================== ADVANCED / OPTIMIZER ==================== */
.optional-box {
  margin: 10px 0 14px;
}

.optional-box > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

/*!* Optional boxes: add a bordered "card" around the content when expanded *!*/
/*details.optional-box[open] > :not(summary),*/
/*details.collapsible-fieldset[open] > :not(summary) {*/
/*  border: 1px solid var(--border, #e5e7eb);*/
/*  border-radius: 12px;*/
/*  padding: 14px 14px 16px;*/
/*  margin-top: 10px;*/
/*  background: var(--surface, #fff);*/
/*  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);*/
/*}*/

.adv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 14px;
  margin-top: 8px;
}

.adv-item label {
  display: block;
  margin-bottom: 4px;
}

.adv-item input,
.adv-item select {
  width: 100%;
  padding: 6px 8px;
}

.adv-actions {
  margin-top: 10px;
}

.optional-box > summary.adv-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
}

.optional-box .adv-hint {
  font-size: 0.9rem;
  color: #666;
  font-weight: normal;
  white-space: nowrap;
}

.apv-calc {
  font-style: italic;
  color: var(--primary);
}

.apv-calc-result-display {
  display: inline-block;
  width: 100px;
  text-align: right;
  font-weight: normal;
  color: var(--primary);
}

/* ==================== UPLOAD PROFILE ==================== */
#profilenr {
  width: 220px;
  flex: 1 1 auto;
  min-width: 160px;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  background: var(--filebtn-bg);
  color: var(--filebtn-fg);
  border: 1px solid var(--filebtn-bd);
  border-radius: var(--filebtn-radius);
  padding: var(--filebtn-pad);
  font: inherit;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover,
.filelike-button:hover {
  background: #e9e9e9;
  border-color: #666;
}

input[type="file"]::file-selector-button:focus-visible,
input[type="file"]::-webkit-file-upload-button:focus-visible,
.filelike-button:focus-visible {
  outline: 2px solid #4d90fe;
  outline-offset: 2px;
}

#upload-profile-btn.blue-button {
  padding: 3px 10px;
  min-height: 32px;
}

#upload-own-profile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

#upload-own-profile > label {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
}

#upload-own-profile .file-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#upload-own-profile .file-input-row input[type="file"] {
  flex: 0 0 auto;
  width: auto;
}

#upload-own-profile .file-input-row .file-name {
  flex: 0 1 750px;
  max-width: 750px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
  line-height: 1.2;
}

#upload-own-profile .file-input-row .helper-inline {
  flex: 0 0 auto;
  margin-left: 4px;
}

#upload-own-profile .upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

#upload-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 220px;
  min-height: 36px;
  padding: 6px 12px;
  white-space: normal;
  flex-direction: column;
  line-height: 1.2;
}

#upload-own-profile .upload-actions .helper-inline {
  margin-left: 6px;
}

#upload-own-profile #upload-result {
  font-size: 0.85rem;
  color: var(--color-helper-text, #555);
  flex: 1 1 320px;
  min-width: 0;
  white-space: normal;
  display: inline-block;
  max-width: 100%;
}

#upload-own-profile .upload-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
}

#upload-own-profile .upload-mode-row label {
  text-align: left;
  margin-right: 8px;
}

#upload-own-profile .upload-sub-label {
  min-width: 110px;
  font-weight: 600;
}

#upload-own-profile .upload-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#upload-own-profile .upload-mode-row select {
  min-width: 520px;
  width: min(100%, 720px);
  max-width: 100%;
  margin-left: 0;
}

#upload-own-profile .upload-sub-label {
  min-width: 110px;
  font-weight: 600;
}

#upload-own-profile .upload-mode-row,
#upload-own-profile .upload-mode-row * {
  justify-content: flex-start;
  text-align: left;
}

#upload-single-block,
#upload-split-block {
  width: 100%;
}

#upload-split-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#upload-single-block,
#upload-split-block {
  width: 100%;
}

#upload-split-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#upload-profile-btn .button-main {
  display: block;
}

#upload-profile-btn .button-subtext {
  display: block;
  margin-top: 2px;
  font-size: 0.8em;
  font-weight: normal;
  opacity: 0.9;
}

.profilenr-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.profilenr-select {
  min-width: 220px;
  height: 35px;
  width: 100%;
  max-width: 100%;
}

/* ==================== MISC ==================== */
#tab-simulations > p:first-of-type{margin:0 0 10px;color:var(--muted);font-size:.9rem;}

.key-value {
  display: flex;
  justify-content: space-between;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  width: 100%;
}

#toggleOverzicht4SeizoenenButton {
  width: 100%;
  max-width: 600px;
  margin: 10px 200px;
}

.xl-block {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.xl-block select {
  padding: 2px 6px;
}

.xl-lab {
  font-size: .9rem;
  opacity: .8;
}

.sep {
  margin: 0 .25rem;
}

.helper-calc-text {
  font-size: 0.9em;
}

/* ==================== ANIMATIONS ==================== */
@keyframes graphs-spin {
  to { transform: rotate(360deg); }
}


/* ==================== RESULTS DOCK ==================== */
/* Disabled: it duplicates the inline results and blocks the UI.
   If you want it back later, remove this rule and restore the HTML block. */
.results-dock{ display:none; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1400px) {
  .pvgis-grid {
    grid-template-columns: 1fr;
  }

  .pvgis-left,
  .pvgis-right {
    min-width: 0;
  }
}

/* Allow PVGIS left-column rows to wrap instead of overflowing into the map column */
.pvgis-left .form-group {
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Prevent any child from forcing overflow in grid/flex */
.pvgis-left .form-group > * {
  min-width: 0;
}

/* Address input should be responsive, despite inline style="width:360px;" in HTML */
#geo_address {
  flex: 1 1 360px;
  width: min(520px, 100%) !important;   /* overrides the inline width safely */
  max-width: 520px;
}

/* Buttons should stay compact and move to the next line if needed */
#btnGeocode,
#btnGeolocate {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Status text should drop to a new line when it doesn't fit */
#geo_status {
  flex: 1 1 100%;
}

/*@media (max-width: 980px) {*/
/*  .row-grid-3 {*/
/*    grid-template-columns: repeat(2, minmax(360px, 1fr));*/
/*  }*/
/*}*/

@media (max-width: 768px) {
  .buttons-wrapper {
    flex-direction: column;
  }

  .loading-message {
    width: 95%;
    margin: 10px auto;
  }
}

@media (max-width: 760px) {
  /*.row-grid-2 {*/
  /*  grid-template-columns: 1fr;*/
  /*}*/

  /*.row-grid-3 {*/
  /*  grid-template-columns: 1fr;*/
  /*}*/
}

@media (max-width: 720px) {
  .form-group {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .form-group > label {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: left;
  }

  .form-group input,
.form-group select {
    width: min(260px, 100%);
  }

  .form-group .helper-text {
    flex-basis: 100%;
  }

  #tab-entsoe .entsoe-field-stack {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .optional-box .adv-hint {
    white-space: normal;
    margin-top: 2px;
  }

  #upload-own-profile {
    align-items: stretch;
  }

  #upload-own-profile .file-input-row {
    flex-direction: column;
    align-items: flex-start;
  }

  #upload-own-profile .file-input-row .file-name {
    width: 100%;
    max-width: 100%;
  }

  #upload-own-profile .upload-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  #upload-profile-btn {
    min-width: 0;
    width: 100%;
  }

  #upload-own-profile #upload-result {
    flex: 1 1 auto;
    width: 100%;
  }
}


/* Analysis: controls layout */
#tab-analysis .analysis-controls{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#tab-analysis .analysis-top-row{
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

#tab-analysis .analysis-axis-row{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

#tab-analysis .analysis-mini-group{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

#tab-analysis .analysis-mini-group > label{
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  text-align: left;
  padding-right: 0;
}

#tab-analysis .analysis-select-wide{
  width: 260px;
  min-width: 260px;
  text-align: left;
}

@media (max-width: 900px) {
  #tab-analysis .analysis-select-wide{
    width: 100%;
    min-width: 0;
  }
}

#tab-analysis .analysis-select-wider{
  width: 650px;
  min-width: 500px;
  text-align: left;
}

@media (max-width: 900px) {
  #tab-analysis .analysis-select-wider{
    width: 100%;
    min-width: 0;
  }
}

/* Analysis: excel source selector */
#tab-analysis .analysis-source-row{
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

#tab-analysis .analysis-radio-group{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

#tab-analysis .analysis-radio{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

#tab-analysis .analysis-existing-inline{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#tab-analysis .analysis-neutral-btn{
  background: #f5f5f5;
  color: #222;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

#tab-analysis .analysis-neutral-btn:hover{
  border-color: var(--primary);
}

/* Analysis: parameters sheet panel */
#tab-analysis .analysis-params-panel{
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  max-width: 1400px;
}

#tab-analysis .analysis-params-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#tab-analysis .analysis-params-filename{
  color: #666;
  font-weight: 400;
  margin-left: 6px;
}

#tab-analysis .analysis-params-body{
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

#tab-analysis table.analysis-params-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

#tab-analysis table.analysis-params-table th,
#tab-analysis table.analysis-params-table td{
  border: 1px solid #e5e5e5;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

#tab-analysis table.analysis-params-table th{
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 1;
}

/* Analysis: plot container */
#analysis-plot-wrap{
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

#analysis-plot-frame{
  width: 100%;
  display: block;
  border: 1px solid #ddd;
  border-radius: 8px;

  /* responsive height, but not crazy */
  height: clamp(520px, 70vh, 950px);
}

.analysis-excel-source{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.analysis-radio{
  display: flex;
  align-items: center;
  gap: 10px;
}

#analysis-existing-excel-controls{
  display: flex;
  gap: 10px;
  align-items: center;
}

/* label links moet bovenaan uitlijnen tov de 2 radio-rows */
#tab-analysis .analysis-source-row .analysis-mini-group{
  align-items: flex-start;
}

/* 1 rij = radio + (optioneel) dropdown */
#tab-analysis .analysis-radio-row{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;            /* mobiel: dropdown mag naar volgende lijn */
}

#tab-analysis .analysis-radio{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

#tab-analysis .analysis-existing-inline{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Analysis: excel source selector (stacked lines) */
#tab-analysis .analysis-source-row{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

#tab-analysis .analysis-source-line{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#tab-analysis .analysis-radio-inline{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

/* Analysis: boxplots controls aligned with plots */
#tab-analysis .analysis-boxplot-row{
  width: 100%;
  max-width: 1400px;
  margin: 6px auto 0 auto;

  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

/* stack label + select nicely, full width of the column */
#tab-analysis .analysis-boxplot-row .analysis-mini-group{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

#tab-analysis .analysis-boxplot-row .analysis-mini-group > label{
  width: auto;
  padding-right: 0;
  text-align: left;
}

/* override fixed 260px select width inside the row so it matches the plot column */
#tab-analysis .analysis-boxplot-row .analysis-select-wide{
  width: 100%;
  min-width: 0;
  text-align: left;
}

/* keep plots grid */
#tab-analysis .analysis-boxplots-wrap{
  width: 100%;
  max-width: 1400px;
  margin: 12px auto 0 auto;

  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
}

/* responsive: stack on smaller screens */
@media (max-width: 900px) {
  #tab-analysis .analysis-boxplot-row{
    grid-template-columns: 1fr;
  }
  #tab-analysis .analysis-boxplots-wrap{
    grid-template-columns: 1fr;
  }
}


#tab-analysis .analysis-boxplot{
  margin: 0;
  padding: 10px;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  background: #fff;
}

#tab-analysis .analysis-boxplot img{
  width: 100%;
  height: auto;
  max-height: 620px;     /* allow taller boxplot */
  object-fit: contain;   /* keep aspect ratio */
  display: block;
}

#tab-analysis .analysis-boxplot figcaption{
  margin-top: 6px;
  font-size: 1.0rem;     /* bigger caption */
  color: #444;
  word-break: break-word;
}

#tab-analysis .analysis-boxplot img + img{
  margin-top: 10px;
}


/* Analysis: download Excel button */
#analysis-download-excel {
  margin-left: 8px;
}

.spinner-progress-wrap { margin-top: 10px; width: 260px; }
.spinner-pct { text-align: right; font-size: 13px; opacity: 0.9; margin-bottom: 6px; }

.spinner-bar { height: 8px; background: rgba(255,255,255,0.25); border-radius: 999px; overflow: hidden; }
.spinner-bar-fill { height: 100%; width: 0%; background: rgba(255,255,255,0.9); border-radius: 999px; transition: width 200ms linear; }

/* optioneel: als je geen % hebt -> indeterminate */
.spinner-bar.indeterminate .spinner-bar-fill {
  width: 35%;
  animation: indet 1s infinite linear;
}
@keyframes indet {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* ==================== Fluvius Profiles tab ==================== */
#tab-fluvius-profiles .fluvius-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin: 10px 0 14px 0;
}

#tab-fluvius-profiles .fluvius-refresh-wrap{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#tab-fluvius-profiles .fluvius-refresh-wrap[hidden]{
  display: none !important;
}

#tab-fluvius-profiles .fluvius-refresh-note{
  font-size: 11px;
  color: #666;
  line-height: 1.15;
  max-width: 240px;
}

#tab-fluvius-profiles .fluvius-select{
  min-width: 180px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

#tab-fluvius-profiles .fluvius-table{
  display:flex;
  flex-direction:column;
  gap:10px;
}

#tab-fluvius-profiles .fluvius-row{
  display:grid;
  grid-template-columns: minmax(90px, 140px) 220px 1fr 1fr 1fr 1fr;
  gap:10px;
  align-items:start;
  padding:10px;
  border:1px solid #e0e0e0;
  border-radius:10px;
  background:#fff;
  overflow:hidden;
}

@media (max-width: 1200px){
  #tab-fluvius-profiles .fluvius-row{
    grid-template-columns: minmax(90px, 140px) 200px 1fr 1fr;
    grid-auto-rows: auto;
  }
}

@media (max-width: 780px){
  #tab-fluvius-profiles .fluvius-row{
    grid-template-columns: 1fr;
  }
}

#tab-fluvius-profiles .fluvius-cell-title{
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

#tab-fluvius-profiles .fluvius-metrics{
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
}

#tab-fluvius-profiles .fluvius-metrics .k{
  color:#333;
}
#tab-fluvius-profiles .fluvius-metrics .v{
  color:#111;
  font-weight: 600;
}

#tab-fluvius-profiles .fluvius-thumb{
  width: 100%;
  height: 150px;
  object-fit: contain;
  border:1px solid #eee;
  border-radius: 8px;
  background:#fafafa;
}

#tab-fluvius-profiles .fluvius-thumbwrap{
  display:flex;
  flex-direction:column;
}

#tab-fluvius-profiles .fluvius-loading{
  padding:10px;
  border:1px dashed #bbb;
  border-radius:10px;
  color:#555;
}


/* Fluvius Profiles: show original profilenr under the current nr */
.fluvius-profile-sub {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
}

#tab-fluvius-profiles .fluvius-profilenr{
  font-size: 20px;
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

#tab-fluvius-profiles .fluvius-profilenr-other{
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#tab-fluvius-profiles #fluvius-cancel-build{
  display: none;
}


/* ==================== ENTSO-e tab ==================== */
#tab-entsoe .entsoe-controls{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0 14px 0;
}

#tab-entsoe .entsoe-form-group{
  align-items: flex-start;
}

#tab-entsoe .entsoe-select{
  min-width: 320px;
  width: 420px;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
}

#tab-entsoe .entsoe-inline-group input{
  width: 280px;
}

#tab-entsoe .entsoe-actions{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

#tab-entsoe .entsoe-plot-wrap{
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  padding: 12px;
}

#tab-entsoe .entsoe-plot{
  width: 100%;
  min-height: 520px;
}

#tab-entsoe .entsoe-summary-wrap{
  margin-top: 18px;
}

#tab-entsoe .entsoe-summary-table-wrap{
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  padding: 10px;
}

#tab-entsoe .entsoe-summary-table{
  min-width: 760px;
}

.entsoe-summary-table th.num,
.entsoe-summary-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.entsoe-summary-table th:first-child,
.entsoe-summary-table td:first-child {
  text-align: left;
}

#tab-entsoe .entsoe-empty{
  padding: 14px;
  border: 1px dashed #bbb;
  border-radius: 10px;
  color: #555;
  background: #fafafa;
}

#tab-entsoe .entsoe-date-nav{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  max-width: 100%;
}

#tab-entsoe .entsoe-date-nav input{
  width: 280px;
}

#tab-entsoe .entsoe-date-nav button{
  min-width: 42px;
  height: 38px;
  padding: 0 10px;
  font-size: 1rem;
  line-height: 1;
}

#tab-entsoe .entsoe-date-nav button:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

#tab-entsoe .entsoe-inline-group{
  flex-wrap: wrap;
}

#tab-entsoe .entsoe-quick-range{
  flex-basis: 100%;
  margin-left: calc(var(--label-col) + 10px);
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#tab-entsoe .entsoe-quick-range button{
  padding:4px 10px;
  font-size:0.85rem;
}

#tab-entsoe .entsoe-select,
#tab-entsoe .entsoe-select option{
  text-align: left;
}

#tab-entsoe .entsoe-panels {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 12px;
}

#tab-entsoe .entsoe-panel {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  padding: 14px 16px;
}

#tab-entsoe .entsoe-panel-title {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #111827;
}

#tab-entsoe .entsoe-panel-intro {
  margin: 0 0 10px 0;
}

#tab-entsoe .entsoe-actions-prices,
#tab-entsoe .entsoe-actions-generation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  justify-content: flex-start;
}

#tab-entsoe .entsoe-actions-generation {
  margin-top: 4px;
}

#tab-entsoe .entsoe-action-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#tab-entsoe .entsoe-action-status {
  display: block;
  width: 100%;
  margin-left: 0;
}

#tab-entsoe .entsoe-info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #bfc6d1;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: #4b5563;
  background: #f8fafc;
  cursor: help;
  user-select: none;
}

#tab-entsoe .entsoe-inline-group-with-action {
  align-items: flex-start;
}

#tab-entsoe .entsoe-field-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 420px;
  max-width: 100%;
}

#tab-entsoe .entsoe-field-stack > input,
#tab-entsoe .entsoe-field-stack > select {
  width: 100%;
  max-width: 100%;
}

#tab-entsoe .entsoe-load-note {
  flex: 1 0 100%;
  margin-top: -2px;
}

/* --- df_profilenr: sticky header + sticky first column --- */
.profilenr-table-wrap{
  overflow: auto;
  max-height: 70vh;   /* pas aan naar smaak */
}

/* belangrijk: sticky werkt betrouwbaarder met separate */
.profilenr-table-wrap table{
  border-collapse: separate;
  border-spacing: 0;
}

/* sticky header */
.profilenr-table-wrap thead th{
  position: sticky;
  top: 0;
  z-index: 3;
}

/* sticky index column (pandas zet index meestal als <th> in tbody) */
.profilenr-table-wrap tbody th{
  position: sticky;
  left: 0;
  z-index: 2;
}

/* top-left corner cell moet boven alles */
.profilenr-table-wrap thead th:first-child{
  left: 0;
  z-index: 4;
}

.download-actions{
  margin: 8px 0 10px 0;
}

.download-link{
  font-size: 0.92rem;
  text-decoration: underline;
  opacity: 0.85;
}

.download-link:hover{
  opacity: 1;
}

#generation-plot-title {
  font-weight: normal;
  text-align: center;
}

@media (max-width: 720px) {
  #tab-entsoe .entsoe-select {
    min-width: 0;
    width: 100%;
  }

  #tab-entsoe .entsoe-inline-group input,
  #tab-entsoe .entsoe-date-nav input,
  #tab-entsoe #entsoe_timezone {
    width: 100%;
    max-width: 100%;
  }

  #tab-entsoe .entsoe-date-nav {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  #tab-entsoe .entsoe-date-nav button {
    flex: 0 0 auto;
  }

  #tab-entsoe .entsoe-date-nav input {
    flex: 1 1 100%;
    min-width: 0;
  }

  #tab-entsoe .entsoe-quick-range {
    width: 100%;
  }

  #tab-entsoe .entsoe-quick-range button {
    flex: 1 1 auto;
  }

  #tab-entsoe .entsoe-actions {
    align-items: stretch;
  }

  #tab-entsoe #entsoe-load {
    width: 100%;
  }

  #tab-entsoe .entsoe-plot {
    min-height: 380px;
  }
}

@media (max-width: 980px) {
  #tab-entsoe .entsoe-form-group,
  #tab-entsoe .entsoe-inline-group{
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #tab-entsoe .entsoe-form-group > label,
  #tab-entsoe .entsoe-inline-group > label{
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: left;
  }

  #tab-entsoe .entsoe-select{
    min-width: 0;
    width: min(420px, 100%);
  }

  #tab-entsoe .entsoe-date-nav{
    display: flex;
    flex: 1 1 100%;
    width: min(420px, 100%);
    flex-wrap: nowrap;
    gap: 8px;
  }

  #tab-entsoe .entsoe-date-nav input{
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  #tab-entsoe .entsoe-quick-range{
    flex: 1 1 100%;
    margin-left: 0;
  }

  #tab-entsoe #entsoe-day-nav-note{
    flex: 1 1 100%;
  }

  #tab-entsoe .entsoe-field-stack {
    width: min(420px, 100%);
  }
}
