/* https://www.canva.com/colors/color-wheel/?msockid=3fd8f1c633f0621e17f8e7193291630f */
:root {
  /* Brand (laat jouw kleuren staan) */
  --hoofdkleur: #39B5FF;
  --corporatie: #8CD853;
  --steunkleur: #336599;

  /* Tetradics */
  --hoofdkleur-t1: #E639FF;
  --hoofdkleur-t2: #FF8339;
  --hoofdkleur-t3: #52FF39;

  --corporatie-t1: #53CFD8;
  --corporatie-t2: #9F53D8;
  --corporatie-t3: #D85D53;

  --steunkleur-t1: #993398;
  --steunkleur-t2: #996733;
  --steunkleur-t3: #339934;

  /* tablecolors */
  --tabellinks: rgba(0, 157, 224, 0.2);
  --lft_culumn-txt: var(--text);

  /*  */
  --greenish: #2F3A44;

  /* Tooling neutrals */

  --surface: #fafaf8;

  --surface-2: #ffffff;
  --border: #d7dee7;
  --border-strong: #c4ccd8;
  --text: #1f2937;
  --text-muted: #556274;
  --datac: #0f2940;

  /* States */
  --danger: #d93025;
  --success: #137333;
  --focus: rgba(57, 181, 255, .35);

  /* Sizing */
  --radius: 10px;
  --radius-sm: 8px;

  --shadow-xs: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow-sm: 0 2px 4px rgba(17, 24, 39, .08);
  --shadow: 0 8px 18px rgba(17, 24, 39, .12);
  --shadow-md: 0 12px 28px rgba(17, 24, 39, .15);
  --shadow-lg: 0 18px 48px rgba(17, 24, 39, .18);

  --h: 44px;
  /* input/button hoogte (tooling standaard) */
  --gap-1: 8px;
  --gap-2: 12px;
  --gap-3: 16px;
  --gap-4: 20px;
  --gap-5: 24px;

  --font-heading: 'League Spartan', sans-serif;
  --font-body: 'Montserrat', sans-serif;

  --text-sm: clamp(0.75rem, 0.8vw, 0.9rem);
  --text-md: clamp(0.9rem, 1vw, 1.1rem);
  --text-lg: clamp(1rem, 1.2vw, 1.4rem);


  --settings-box-wdth: clamp(80px, 10vw, 160px);
  --settings-box-lngth: clamp(20px, 4vh, 30px);
  --settings-modal-wdth: auto;
  --settings-modal-lngth: auto;


}

/* 1) Basis: rustigere pagina */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;

}

body {
  background: var(--surface);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);  
  /* overflow: hidden; */
  /* Prevent page-level scrollbar */

}

*,
*::before,
*::after {
  box-sizing: border-box;
}

h1,
h2,
h3,
.header-title {
  /* UPPERCASE is ok, maar niet overal schreeuwerig */
  letter-spacing: .6px;
  font-family: var(--font-heading) clamp(30px, 4vh, 50px);
}

h2,
h3 {
  text-transform: none;
}

/* 2) Layout container: tooling voelt beter met vaste "gutter" */
.content {
  padding: var(--gap-5) var(--gap-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;    /* ADD THIS */

  /* Allow content to flex and handle internal scrolling */
}

@media (max-width: 900px) {
  .content {
    padding: var(--gap-4) var(--gap-3);
  }
}

/* 3) Header: minder "blok groen", meer calm tooling bar
      (brand blijft als accent) */
header,
footer {
  background: var(--surface);
  color: var(--text);
  border: 0;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .06);
  padding: 12px var(--gap-4);
  flex-shrink: 0;
  /* Don't shrink header and footer */
}

header {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  top: 0;
  z-index: 50;
  /* brand accent line */
    background: var(--steunkleur);   /* muted blue instead of near-black --datac */
    border-top: 4px solid var(--corporatie);
    box-shadow: var(--shadow-sm);


  justify-content: space-between;
  align-items: center;


}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  border-bottom: 0;
  border-top: 1px solid var(--border);
  margin-top: auto;  
}

.header-title {
  font-size: 18px;
  /* compacter */
  text-transform: none;
  /* tooling: leesbaar */
  letter-spacing: .2px;
  color: #ffffff;

}

/* 4) Cards/sections: tooling = white surface + subtiele rand */
section,
.login-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  /* width: 30%; */
}

section {
  padding: var(--gap-5);
  margin-bottom: var(--gap-4);
}

section, .data-table {
    background: var(--surface-2); /* white cards on off-white page */
}

.data-table {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--gap-5);
  margin-bottom: 0 !important;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
}

.login-frame {
  overflow: hidden;
  width: 30%; 
}


/* 5) Forms: voorspelbaar, scanbaar, goede states */
form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-3);
  align-items: flex-end;
}

.form-group {
  margin-bottom: 0;
  /* gaps regelen spacing */
  flex: 1 1 260px;
  /* mooie grid-flow */
  min-width: 220px;
}

label {
  display: inline-block;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

/* helper text (optioneel in HTML als <div class="help">…) */
.help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* inputs */
input[type="search"],
input[type="email"],
input[type="password"],
input[type="text"],
select,
.form-control {
  box-shadow: var(--shadow-xs);
  width: 100%;
  height: var(--h);
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input::placeholder {
  color: #a88a8a;
}

input:hover,
select:hover {
  border-color: #9aa8bb;
}

input:focus,
select:focus {
  outline: none !important;
  border-color: var(--hoofdkleur);
  box-shadow: 0 0 0 4px var(--focus);
}

/* disabled */
input:disabled,
select:disabled {
  background: #f1f3f6;
  color: #8a97a8;
  cursor: not-allowed;
}

/* error state (gebruik class .is-invalid op input/select) */
.is-invalid {
  border-color: rgba(217, 48, 37, .7) !important;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, .18) !important;
}

.error-text {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

/* 6) Buttons: primary / secondary / danger duidelijk */
button, .btn,a {
  height: var(--h);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .05s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-transform: none;
  /* tooling: niet alles uppercase */
  font-family: var(--font-body);
  /* leesbaar voor knoppen */
}

button:active {
  transform: translateY(1px);
}

/* Primary */
.btn-primary,
button[type="submit"],
.filters-submit {
  background: var(--hoofdkleur);
  color: #062033;
  box-shadow: 0 4px 12px rgba(57, 181, 255, .25);
}

.btn-primary:hover,
button[type="submit"]:hover,
.filters-submit:hover {
  filter: brightness(.95);
}

.btn-primary:focus,
button[type="submit"]:focus,
.filters-submit:focus {
  outline: none !important;
  box-shadow: 0 0 0 4px var(--focus);
}

/* Secondary */
.btn-secondary {
  background: #ffffff;
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;

}

.btn-secondary:hover {
  background: #f6f7f9;
  border-color: #9aa8bb;
}

/* Danger (logout) – consistent */
.logout-btn,
.btn-danger {
  background: var(--greenish);
  color: var(--hoofdkleur-t2);
  border: 1px solid;
  border-color: rgba(255, 131, 57, 0.4);
  height: var(--h);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover,
.btn-danger:hover {
    background: rgba(255, 131, 57, 0.1);
    border-color: var(--hoofdkleur-t2);
}


/* 8) Tables: UX voor tooling (sticky header, zebra, hover) */
.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 300px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  /* Remove max-height constraint; let flex handle it */
}

table {
  width: auto;
  min-width: 100%;
  table-layout: auto; 
  border-collapse: separate;
  border-spacing: 0;
  background: #f8f9fa;
}

/* Limit first column width in data-table */
.data-table th:first-child {
  max-width: 20vh;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

th, /* Tablehead */
.total-cell  {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--steunkleur);
  /* rustiger dan fel blauw */
  color: #ffffff;
  text-transform: none;
  font-family: var(--font-heading);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin: 20px;
}

/* zebra + hover (snel scannen) */
tbody tr:nth-child(even) {
  background: rgba(57, 181, 255, 0.04);
  /* Beige background on every 2nd row */
}

tbody tr:hover {
  background: rgba(57, 181, 255, 0.08);
}


/* 10) Motion respect */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.footer-logo {
  height: 50px;
  width: auto;
  max-width: 100%;
}

/* Force left alignment for all DataTable cells + headers */
table th, /* Tablehead */
table td {
  text-align: left !important;
  max-width: 40%;
}

/* Visually hidden (screen reader only) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Info button */
.info-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 6px;
    color: #ffffff;
}

.info-btn:focus {
    outline: 2px solid #005a9c;
    outline-offset: 2px;
}

/* Tooltip */
.tooltip {
    display: none;
    position: absolute;
    background: #ffffff;
    color: #000000;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    max-width: 220px;
    z-index: 1000;
    border: 2px solid #003366;
}

/* Show tooltip on hover AND focus */
.info-btn:hover + .tooltip,
.info-btn:focus + .tooltip {
    display: inline-block;
}


.logout-btn {
    margin-left: auto;
}

/* ===== Company + Table 2-column layout ===== */

.dtable {
  display: flex;
  gap: var(--gap-4);
  align-items: stretch;
  /* overflow: hidden;  */
  /* Prevent internal scrolling from dtable itself */
}

/* Right column (table) */
#tableContainer {
  box-shadow: none;              /* remove shadow from container */
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  display: flex;
  gap: var(--gap-4);
  align-items: stretch;
  /* overflow: hidden; */
  /* border-radius: 22px; */
  /* Prevent overflow; let table-wrap handle scrolling */
  border-radius: var(--radius);  /* ADD — matches child */
  background: transparent; 
  /* max-height: 90vh; */
}

.company-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--datac);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--datac);
  background-color: var(--white);
  overflow: hidden;
}

.company-item:hover {
  background: #005b9c;
  border-color: var(--hoofdkleur);
  color: #ffffff;
}

.company-selector-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--steunkleur);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--gap-4);
  margin-bottom: var(--gap-4);
  flex-shrink: 0;
  /* Don't shrink the selector */  
  position: relative;
}

.table-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  width: fit-content;  
  min-width: 400px;
  max-width: 100%;
  max-height: 75vh;          /* ADD — limits height, triggers scroll */

  scroll-behavior: smooth;
}

.category-link {
    cursor: pointer;
    color: var(--surface);
    font-weight: 700;
}

.category-link:hover {
    color: var(--corporatie-t1);
    text-decoration: underline;
}

/* Settings Button */
.settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: rgba(255,255,255,0.8);
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Important: make clickable area at least 44x44px (WCAG target size) */
    min-width: 44px;
    min-height: 44px;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.settings-btn-wrapper label {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0;
    font-weight: 600;
    cursor: pointer;
}

.settings-btn:focus {
    outline: 2px solid var(--hoofdkleur);
    outline-offset: 2px;
}

/* Modal Backdrop */
#settingsModal {
    position: fixed;
    inset: 0; /* same as top:0; left:0; right:0; bottom:0 */
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Hide modal when it has hidden attribute */
#settingsModal[hidden] {
    display: none;
}

.settings-modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: var(--gap-5);
    max-width: 90vw;
    width: var(--settings-modal-wdth);
    /* Ensure content stays on screen on mobile */
    max-height: 90vh;
    height: var(--settings-modal-lngth);
    overflow-y: auto;
    padding: 2vw;
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-4);
}

.settings-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.settings-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 44px; /* WCAG: min 44x44px clickable area */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background .15s ease;
}

.settings-modal-close:hover {
    color: var(--text);
    background: var(--surface-2);
}

.settings-modal-close:focus {
    outline: 2px solid var(--hoofdkleur);
    outline-offset: 2px;
}

/* Form Group */
.settings-group {
    margin-bottom: var(--gap-4);
}

.settings-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--gap-2);
    color: var(--text);
}

/* Action Buttons */
.settings-actions {
    display: flex;
    gap: var(--gap-2);
    justify-content: flex-end;
    margin-top: var(--gap-4);
}


tfoot {
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.total-row th, /* Tablehead */
.total-row td {
    background: var(--steunkleur-t2);
    color: #ffffff;
    font-weight: 700;
    font-family: var(--font-heading);
    border-bottom: none;  /* ADD THIS — removes the bottom gap */
}

.back-to-company {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    border: none;
    background: none;
    padding: 0;
    transition: color 0.2s;
}

.back-to-company:hover {
  color: var(--steunkleur);
}

/* First column (labels) gets more space */
th:first-child, /* Tablehead */
td:first-child {
  width: clamp(140px, 15vw, 280px);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.settings-device-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--gap-3);
    margin-bottom: var(--gap-3);
}

.settings-device-group h3 {
    margin: 0 0 var(--gap-2) 0;
    font-size: 1.1em;
}

details > summary {
    cursor: pointer;
}

details > summary:hover {
    color: var(--hoofdkleur);
    /* or any color you want */
}
details summary {
    cursor: pointer;
}

/* Data columns (not first column) get a minimum width */
th:not(:first-child), /* Tablehead */
td:not(:first-child) {
  min-width: 100px;
}

.search-wrapper {
    position: relative;
    width: 30%;
    max-width: 450px;
    min-width: 350px;
}

.search-wrapper input {
    width: 100%;
}

.company-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 4px 12px rgba(17,24,39,.15);
    z-index: 300;
    padding: var(--gap-1);
}

.company-dropdown[hidden] {
    display: none;
}

.company-dropdown .company-item {
    margin-bottom: 4px;
}

.company-dropdown .company-item.is-active {
    background: #005b9c;
    border-color: var(--hoofdkleur);
}

.company-item[hidden] {
    display: none !important;
}

#pdf-all-assets-all-years-btn,
.pdf-asset-all-years-detail-btn {
    background: var(--hoofdkleur);
    color: #062033;
    box-shadow: none;
    font-size: 14px;
    height: var(--h);
    padding: 0 var(--gap-4);
    margin: 0;
    cursor: pointer;
           /* slightly smaller than the default --h: 44px */
}


#pdf-all-assets-all-years-btn:hover,
.pdf-asset-all-years-detail-btn:hover {
    filter: brightness(0.95);
}

.alert-warning {
    background: rgba(255, 131, 57, 0.1); /* --hoofdkleur-t2 tint */
    border: 1px solid rgba(255, 131, 57, 0.4);
    border-left: 4px solid var(--hoofdkleur-t2);
    border-radius: var(--radius-sm);
    padding: var(--gap-3) var(--gap-4);
    color: var(--text);
    font-size: 14px;
    margin-bottom: var(--gap-3);
}

/* .data-table h2 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: var(--gap-3);
    padding-bottom: var(--gap-2);
    border-bottom: 1px solid var(--border);
} */

tbody th { /* Tablehead */
    background-color: var(--tabellinks);
    color: var(--lft_culumn-txt);
    position: relative;
    z-index: 0;
}

.table-placeholder {
    color: var(--text-muted);
    font-size: clamp(30px, 3vh, 40px);
    font-style: italic;
    padding: var(--gap-4);
    text-align: center;
    user-select: none;
}

.company-item.active {
    background: var(--steunkleur);
    border-left: 4px solid var(--hoofdkleur);
    color: #ffffff;
}

.table-header-row {
    display: flex;
    gap: var(--gap-3);          /* button sits close to title */
    align-items: center;
    margin-bottom: var(--gap-3);
}

th, /* Tablehead */
.total-cell,
td {
  font-size: clamp(16px, 1.2vw, 18px);
  padding: clamp(12px, 1vw, 18px) clamp(12px, 1.5vw, 20px);
  border-bottom: 1px solid #eef2f7;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;           /* bump above tbody's z-index: 0 */
    background: var(--steunkleur);  /* already set, but must be solid — no transparency */
}

/* modal text size */
details summary { font-size: var(--text-lg); } 
.settings-group label { font-size: var(--text-md); }
.help { font-size: var(--text-sm); }


.multiplier-input {
  width: var(--settings-box-wdth);
  height: var(--settings-box-lngth);
}