/* Proud Nerds theme for Tabler: overrides Tabler's CSS variables, so
   tabler.min.css stays untouched and can be upgraded as is. Load it after
   tabler.min.css and the fonts (Red Hat Display 600/700, Nunito Sans
   400/600/700). Rules for what Tabler has no component for go below the
   marker at the bottom. */

:root {
  /* brand colours */
  --tblr-primary: #221e17;
  --tblr-primary-fg: #ffffff;
  --tblr-link-color: #8a6414;
  --tblr-link-hover-color: #6b4d0f;

  /* status colours, same hues as the existing interface */
  --tblr-success: #5aa152;
  --tblr-warning: #b8830f;
  --tblr-danger: #c9432a;
  --tblr-form-invalid-color: #b23a24;
  --tblr-info: #3a6076;

  /* type */
  --tblr-font-sans-serif: "Nunito Sans", system-ui, sans-serif;
  --tblr-body-font-size: 0.875rem;
  --tblr-font-size-h2: 1.125rem;

  /* shape */
  --tblr-border-radius: 0.5rem;

  /* brand tokens */
  --pn-goud: #d0b77c;
  --pn-goud-zacht: #fbf3e2;
  --pn-zijbalk-rand: 3px;
  --pn-zwevend-zindex: 1040;
  --pn-schaduw-zwevend: 0 6px 20px rgba(0, 0, 0, 0.15);
  --pn-info-maat: 1.5rem;
  --pn-info-maat-touch: 2.25rem;
  --pn-bron-maat-touch: 2rem;
  --pn-datagrid-kolom: 9rem;
  --pn-sticky-boven: 3rem;
  --pn-sticky-onder: 7rem;
  --pn-overzicht-rij: 3rem;
  --pn-uitleg-breedte: 800px;
}

/* An empty status line takes no room until it has something to say. */
p:empty {
  display: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.card-title,
.navbar-brand {
  font-family: "Red Hat Display", system-ui, sans-serif;
}

/* Sidebar: brand brown with gold highlights. */
.navbar-vertical[data-bs-theme="dark"] {
  --tblr-navbar-bg: #221e17;
  --tblr-navbar-border-color: rgba(208, 183, 124, 0.15);
  --tblr-navbar-active-bg: rgba(208, 183, 124, 0.18);
}

.navbar-vertical[data-bs-theme="dark"] .nav-item.active > .nav-link {
  box-shadow: inset 3px 0 0 var(--pn-goud);
  color: #ffffff;
}

.navbar-vertical[data-bs-theme="dark"] .nav-link:hover {
  background: rgba(208, 183, 124, 0.1);
}

.navbar-vertical[data-bs-theme="dark"] .nav-item.active .nav-link-icon {
  color: #d0b77c;
}

.navbar-vertical[data-bs-theme="dark"] {
  border-inline-end: var(--pn-zijbalk-rand) solid var(--pn-goud);
}

/* Visible keyboard focus in the brand gold. */
:focus-visible,
.navbar-toggler:focus-visible {
  outline: 3px solid rgba(208, 183, 124, 0.7);
  outline-offset: 1px;
}

/* Brand accents on Tabler components. */
.pn-bg-goud {
  background-color: var(--pn-goud);
}

.card-active {
  --tblr-card-border-color: var(--pn-goud);
  --tblr-card-bg: var(--pn-goud-zacht);
}

/* A table without rows yet shows no empty card. */
.card:has(> .table-responsive > table:empty),
.card:has(> .table-responsive > table > tbody:only-child:empty) {
  display: none;
}

/* A status filter can hide the first accordion item: the first visible item
   then carries the top border that Tabler only gives to the first child. */
.accordion-item:not([hidden]):not(.accordion-item:not([hidden]) ~ *) {
  border-top: var(--tblr-accordion-border-width) solid var(--tblr-accordion-border-color);
}

/* Status colours are too light for text on their soft backgrounds: an alert
   shows its status through border and background, the text stays readable. */
.alert,
.alert-description {
  color: var(--tblr-body-color);
}

.card-active .subheader {
  color: var(--tblr-body-color);
}

/* Tabler styles .table-sort for a button; a server-rendered sort link in a
   table header needs the same look without its own background. */
a.table-sort {
  background: transparent;
}

/* -- Application rules of this project --------------------------------------
   Only for what Tabler has no component for. Give each rule a one-line reason
   and take sizes from --pn-* tokens in :root. */

/* Reviewers must read each full sentence; Tabler has no CSS-only autosize.
   Browsers without field-sizing fall back to the rows attribute. */
.pn-tekst-meegroeien {
  field-sizing: content;
}

/* Keyboard focus and step changes must stay clear of the sticky banner and action bar; Tabler has no utility for scroll padding. */
html {
  scroll-padding-block: var(--pn-sticky-boven) var(--pn-sticky-onder);
}

/* Review summary above the steps: narrower columns keep it short on a phone; Tabler's datagrid is one column there. */
.pn-datagrid-smal {
  --tblr-datagrid-item-width: var(--pn-datagrid-kolom);
}

/* Dossier text keeps its line breaks; Tabler has no utility for pre-line. */
.pn-tekst-regels {
  white-space: pre-line;
}

@media (max-width: 767.98px) {
  /* Tabler's sticky-bottom overlays the preceding content; reserve its height
     before the review action bar so the last content can scroll clear of it. */
  [data-actiebalk] {
    margin-block-start: var(--pn-sticky-onder);
  }
}

/* Tabler dims the steps after the current one below contrast AA; they must stay readable. */
.step-item.active ~ .step-item,
.step-item.active ~ .step-item::before {
  color: var(--tblr-body-color);
}

/* Info icon inside running text and table headers; Tabler's icon button is too
   large there. Touchscreens get a larger target. */
.btn-icon.pn-info {
  --tblr-btn-padding-x: 0;
  --tblr-btn-padding-y: 0;
  --tblr-btn-border-width: 0;
  width: var(--pn-info-maat);
  height: var(--pn-info-maat);
  min-width: var(--pn-info-maat);
  min-height: var(--pn-info-maat);
  vertical-align: middle;
}

@media (pointer: coarse) {
  .btn-icon.pn-info {
    width: var(--pn-info-maat-touch);
    height: var(--pn-info-maat-touch);
    min-width: var(--pn-info-maat-touch);
    min-height: var(--pn-info-maat-touch);
  }

  /* A source code is a link in a Tabler badge, too small to tap. */
  a[data-bron] {
    display: inline-flex;
    align-items: center;
    min-height: var(--pn-bron-maat-touch);
  }
}

/* Catalog-only swatches: Tabler has no palette sample linked to brand tokens. */
:root {
  --pn-logo-donker: #163b3f;
  --pn-logo-groen: #176d67;
  --pn-logo-koper: #a05b1c;
  --pn-kleurstaal-maat: 1.5rem;
  --pn-voorbeeld-inactief: 0.5;
  --pn-handboek-regel: 1.6;
}
.pn-ds-swatch {
  display: inline-block;
  width: var(--pn-kleurstaal-maat);
  height: var(--pn-kleurstaal-maat);
  vertical-align: middle;
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
}
.pn-ds-swatch[data-swatch="primary"] { background: var(--tblr-primary); }
.pn-ds-swatch[data-swatch="goud"] { background: var(--pn-goud); }
.pn-ds-swatch[data-swatch="soft"] { background: var(--pn-goud-zacht); }
.pn-ds-swatch[data-swatch="link"] { background: var(--tblr-link-color); }
.pn-ds-swatch[data-swatch="success"] { background: var(--tblr-success); }
.pn-ds-swatch[data-swatch="warning"] { background: var(--tblr-warning); }
.pn-ds-swatch[data-swatch="danger"] { background: var(--tblr-danger); }
.pn-ds-swatch[data-swatch="info"] { background: var(--tblr-info); }
.pn-ds-swatch[data-swatch="invalid"] { background: var(--tblr-form-invalid-color); }
.pn-ds-swatch[data-swatch="logo-dark"] { background: var(--pn-logo-donker); }
.pn-ds-swatch[data-swatch="logo-green"] { background: var(--pn-logo-groen); }
.pn-ds-swatch[data-swatch="logo-copper"] { background: var(--pn-logo-koper); }
/* A disabled sample includes links and whole panels, beyond fieldset's scope. */
[data-example][inert] { opacity: var(--pn-voorbeeld-inactief); }
/* A brand handbook needs deliberate print sections, which Tabler does not provide. */
.pn-handboek { line-height: var(--pn-handboek-regel); }
@media print {
  @page proudcare-handbook { size: A4; margin: 16mm; }
  .pn-handboek .pn-handboek-deel { break-before: page; }
  .pn-handboek .card, .pn-handboek table { break-inside: avoid; }
  .pn-handboek { page: proudcare-handbook; background: var(--tblr-white); }
  .pn-handboek h1, .pn-handboek h2, .pn-handboek h3 { break-after: avoid; }
}

/* Tabler has no single-line overview variant spanning all cells and status labels. */
.pn-overzicht > :not(caption) > * > * { white-space: nowrap; }
.pn-overzicht tbody td, .pn-overzicht tbody th { height: var(--pn-overzicht-rij); font-size: var(--tblr-body-font-size); }
.pn-overzicht tbody .badge { font-size: inherit; font-weight: var(--tblr-body-font-weight); }
/* Tabler has no native disclosure variant; one marker and heading style across all contexts. */
.pn-details > summary { cursor: pointer; display: list-item; list-style-position: inside; font-size: var(--tblr-body-font-size); font-weight: var(--tblr-body-font-weight); }
/* Keep the mobile editing task in view; only secondary columns move into details. */
@media (max-width: 767.98px) {
  .pn-ureninvoer { table-layout: fixed; width: 100%; }
  .pn-ureninvoer > :not(caption) > * > * { padding-inline: 0.5rem; }
  .pn-ureninvoer input { min-width: 0; width: 100%; }
}

/* The same hours table reveals secondary columns on request without duplicating inputs. */
.pn-kernkolom { display: none; }
@media (max-width: 767.98px) {
  .pn-urentabel .pn-extra-kolom { display: none; }
  .pn-urentabel .pn-kernkolom { display: table-cell; }
  .pn-urentabel:has(> .pn-details[open]) .pn-extra-kolom { display: table-cell; }
  .pn-urentabel:has(> .pn-details[open]) .pn-kernkolom { display: none; }
  .pn-urentabel:has(> .pn-details[open]) .pn-ureninvoer { table-layout: auto; }
}
/* Complete semantic pairs: Tabler utilities consume these tokens in both modes. */
:root, [data-bs-theme="light"] {
  --tblr-success: #176d67;
  --tblr-success-fg: #ffffff;
  --tblr-success-lt: #e6f4ef;
  --tblr-warning: #77520b;
  --tblr-warning-fg: #ffffff;
  --tblr-warning-lt: #fbf3e2;
  --tblr-info: #3a6076;
  --tblr-info-fg: #ffffff;
  --tblr-info-lt: #eaf2f7;
  --tblr-danger: #b23a24;
  --tblr-danger-fg: #ffffff;
  --tblr-danger-lt: #fbece8;
  --tblr-secondary: #595959;
  --tblr-secondary-lt: #f1f1f1;
  --pn-row-hover: #fbf3e2;
  --pn-logo-width: 13rem;
  --pn-current-step: #176d67;
}
[data-bs-theme="dark"] {
  --tblr-body-bg: #171717;
  --tblr-bg-surface: #262626;
  --tblr-body-color: #eeeeee;
  --tblr-secondary: #c4c4c4;
  --tblr-secondary-lt: #303030;
  --tblr-secondary-color: #c4c4c4;
  --tblr-secondary-color-rgb: 196,196,196;
  --tblr-link-color: #e4ca8b;
  --tblr-link-color-rgb: 228,202,139;
  --tblr-link-hover-color: #ffffff;
  --tblr-link-hover-color-rgb: 255,255,255;
  --tblr-success: #a2dfc5;
  --tblr-success-fg: #142b23;
  --tblr-success-lt: #193d32;
  --tblr-warning: #f1d18b;
  --tblr-warning-fg: #33270e;
  --tblr-warning-lt: #3e3018;
  --tblr-info: #b8d8ed;
  --tblr-info-fg: #192d3c;
  --tblr-info-lt: #203b4a;
  --tblr-danger: #ffbaa9;
  --tblr-danger-fg: #44251f;
  --tblr-danger-lt: #44251f;
  --tblr-form-invalid-color: #ffbaa9;
  --pn-goud-zacht: #3e3018;
  --pn-row-hover: #3e3018;
}
/* A full row link keeps native link focus and individual controls intact. */
[data-row-link] { cursor: pointer; }
[data-row-link]:hover > td, [data-row-link]:focus-within > td,
.list-group-item[data-row-link]:hover, .list-group-item[data-row-link]:focus-within {
  background: var(--pn-row-hover);
}
/* Completed steps and their numbers remain visible on both surfaces. */
.steps { --tblr-steps-color: #221e17; }
[data-bs-theme="dark"] .steps { --tblr-steps-color: #c4c4c4; }
[data-bs-theme="dark"] .step-item::before { color: #221e17; }
[data-bs-theme="dark"] .step-item.active ~ .step-item::before { color: var(--tblr-body-color); }
.step-item.active::before, [data-bs-theme="dark"] .step-item.active::before { background: var(--pn-current-step); color: #ffffff; }
/* Logo fills the available sidebar, while the mobile menu keeps its own space. */
.navbar-vertical .navbar-brand-image { width: 100%; height: auto; max-height: none; }
.navbar-vertical .navbar-brand { width: var(--pn-logo-width); max-width: 100%; padding-block: 1rem; }
.navbar-vertical .navbar-brand a { display: block; width: 100%; }
@media (min-width: 992px) {
  .navbar.navbar-vertical .navbar-brand { width: calc(100% - 2rem); margin-inline: 1rem; padding-inline: 0; }
}
.navbar-vertical .nav-link { white-space: normal; }
.navbar.navbar-vertical .navbar-nav .nav-link-title { white-space: normal; overflow: visible; text-overflow: clip; }
.navbar-vertical .nav-link[data-theme-toggle] { width: 100%; border: 0; background: transparent; text-align: start; }
/* All columns remain available within a horizontally scrollable mobile table. */
.tab-content .table-responsive { max-width: 100%; }

/* Neutral labels follow the surface rather than Tabler's fixed light swatch. */
[data-bs-theme="dark"] { --tblr-light: #303030; --tblr-light-rgb: 48,48,48; }
a.table-sort { color: var(--tblr-body-color); }

/* Outline actions use readable gold in dark mode; filled primary actions stay brown. */
[data-bs-theme="dark"] .btn-outline-primary {
  --tblr-btn-color: #e4ca8b;
  --tblr-btn-border-color: #e4ca8b;
  --tblr-btn-hover-color: #221e17;
  --tblr-btn-hover-bg: #e4ca8b;
}

/* The login reuses the existing inverse brand asset on dark surfaces. */
[data-bs-theme="dark"] img[src$="logo-light-bg.svg"] { content: url("brand/logo-dark-bg.svg"); }

/* Tabler offcanvas has no wide reading variant; retain its focus and scroll behaviour. */
.offcanvas.pn-uitleg-breed {
  --tblr-offcanvas-width: min(var(--pn-uitleg-breedte), 100vw);
  overflow-wrap: anywhere;
}
