/* Material Design 2 – dashboard + baseline Material color theme (default purple / teal accent) */
:root {
  /* MD2 baseline palette (Material Design default – primary purple, secondary teal accent) */
  --md2-primary: #6200ee;
  --md2-primary-dark: #3700b3;
  --md2-primary-light: #bb86fc;
  --md2-primary-rgb: 98, 0, 238;
  --md2-accent: #03dac6;
  --md2-error: #b00020;

  --md2-text-primary: rgba(0, 0, 0, 0.87);
  --md2-text-secondary: rgba(0, 0, 0, 0.54);
  --md2-text-disabled: rgba(0, 0, 0, 0.38);
  --md2-divider: rgba(0, 0, 0, 0.12);

  --md2-background: #fafafa;
  --md2-surface: #ffffff;

  /* MD2 elevation (Material spec) */
  --md2-elevation-1: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14),
    0 1px 3px 0 rgba(0, 0, 0, 0.12);
  --md2-elevation-2: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
  --md2-elevation-4: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12);
  --md2-elevation-8: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12);

  --md2-radius-card: 2px;
  --md2-radius-btn: 2px;
  --md2-radius-field: 2px;
  --md2-app-bar-height: 64px;

  /* Legacy aliases (bestaande markup / JS) */
  --brand: var(--md2-primary);
  --brand-dark: var(--md2-primary-dark);
  --brand-light: var(--md2-primary-light);
  --cream: var(--md2-background);
  --cream-deep: #eeeeee;
  --cream-card: var(--md2-surface);
  --teal: var(--md2-primary);
  --teal-dark: var(--md2-primary-dark);
  --mint: #e8def8;
  --mint-soft: #f3e8fd;
  --peach: var(--cream-deep);
  --peach-soft: #f5f5f5;
  --bg: var(--md2-background);
  --card: var(--md2-surface);
  --text: var(--md2-text-primary);
  --muted: var(--md2-text-secondary);
  --line: var(--md2-divider);
  --accent: var(--md2-primary);
  --accent-2: rgba(var(--md2-primary-rgb), 0.12);
  --good: #2e7d32;
  --warn: #f57c00;
  --bad: var(--md2-error);

  --shadow: var(--md2-elevation-2);
  --radius: var(--md2-radius-card);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--md2-background);
  color: var(--md2-text-primary);
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  position: relative;
  z-index: 60;
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* MD2 navigation drawer */
.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--md2-surface);
  border-right: 1px solid var(--md2-divider);
  box-shadow: var(--md2-elevation-2);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  gap: 0;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), padding 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.sidebar.collapsed {
  width: 72px;
  padding: 8px 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 16px;
  border-bottom: 1px solid var(--md2-divider);
  margin-bottom: 8px;
}

.sidebar.collapsed .sidebar-brand {
  flex-direction: column;
  align-items: center;
  padding: 8px 8px 12px;
}

.sidebar-logo-link {
  display: block;
  flex: 1;
  min-width: 0;
  line-height: 0;
  border-radius: var(--md2-radius-card);
  overflow: hidden;
  text-decoration: none;
  outline: none;
}

.sidebar-logo-link:focus-visible {
  box-shadow: 0 0 0 2px var(--md2-surface), 0 0 0 4px var(--md2-primary);
}

.sidebar-logo-link:hover {
  box-shadow: var(--md2-elevation-2);
}

.sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
  background: var(--md2-surface);
}

.sidebar.collapsed .sidebar-logo-link {
  flex: none;
  width: 100%;
}

.sidebar.collapsed .sidebar-logo {
  max-height: 48px;
  object-position: center;
}

.sidebar-brand-text {
  flex: 0 0 auto;
  min-width: 0;
}

.sidebar-title {
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1px;
  color: var(--md2-text-primary);
  white-space: nowrap;
  display: block;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-link span.nav-label {
  display: none;
}

.sidebar-toggle {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--md2-text-secondary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.sidebar-toggle:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--md2-primary);
  outline-offset: 2px;
}

.sidebar-toggle .material-symbols-rounded {
  font-size: 24px;
}

.sidebar.collapsed .sidebar-toggle {
  margin-left: 0;
}

/* MD2 drawer list items */
.nav-link {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 48px;
  padding: 0 16px;
  margin: 0 8px;
  border-radius: 0;
  border-left: 4px solid transparent;
  color: var(--md2-text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.1px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  outline: none;
}

.nav-link:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.nav-link:focus-visible {
  background-color: rgba(0, 0, 0, 0.06);
}

.nav-link.nav-link--active {
  background-color: rgba(var(--md2-primary-rgb), 0.12);
  color: var(--md2-primary);
  border-left-color: var(--md2-primary);
  padding-left: 12px;
}

.nav-icon {
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--md2-text-secondary);
}

.nav-link.nav-link--active .nav-icon {
  color: var(--md2-primary);
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--md2-background);
}

/* MD2 primary app bar (dashboard toolbar) */
.page-header {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  max-width: none;
  min-height: var(--md2-app-bar-height);
  padding: 0;
  background: var(--md2-primary);
  color: #fff;
  box-shadow: var(--md2-elevation-4);
}

.page-header-top {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 16px 8px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.page-header h1 {
  margin: 0 0 2px;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0.15px;
  color: #fff;
}

.page-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  max-width: 560px;
  line-height: 20px;
  font-size: 14px;
  letter-spacing: 0.25px;
}

.global-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.global-search-wrap input[type="search"] {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  padding: 8px 12px 8px 40px;
  min-height: 40px;
  font-weight: 400;
  font-size: 14px;
  color: #fff;
  box-shadow: none;
  transition: background-color 0.15s, border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23ffffff' fill-opacity='0.85' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.global-search-wrap input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.global-search-wrap input[type="search"]:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
}

.global-search-wrap input[type="search"]:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.85);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: 70vh;
  overflow: auto;
  background: var(--md2-surface);
  border-radius: var(--md2-radius-card);
  box-shadow: var(--md2-elevation-8);
  z-index: 400;
  padding: 8px 0;
}

.search-dropdown .search-section-title {
  padding: 12px 16px 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--md2-text-secondary);
}

.search-dropdown button.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--md2-text-primary);
  padding: 12px 16px;
  min-height: 0;
  border-radius: 0;
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--md2-divider);
  box-shadow: none;
  transition: background-color 0.15s;
  text-transform: none;
  letter-spacing: normal;
}

.search-dropdown button.search-hit:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: none;
  box-shadow: none;
}

.search-dropdown button.search-hit small {
  display: block;
  font-weight: 400;
  color: var(--md2-text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

.search-dropdown .search-empty {
  padding: 16px;
  color: var(--md2-text-secondary);
  font-size: 14px;
  text-align: center;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 24px;
  flex: 1;
}

/* Volle breedte binnen .main-area (bijv. productformulier) */
.container.container--fluid {
  max-width: none;
  width: 100%;
}

.page-stack {
  display: grid;
  gap: 24px;
  align-content: start;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-bar label {
  min-width: 200px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* MD2 card */
.card {
  background: var(--md2-surface);
  border: none;
  border-radius: var(--md2-radius-card);
  box-shadow: var(--md2-elevation-2);
  padding: 24px;
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0.15px;
  color: var(--md2-text-primary);
}

.muted {
  color: var(--md2-text-secondary);
}

.note {
  margin-top: 16px;
  padding: 16px;
  background: #fff9c4;
  border-left: 4px solid #fbc02d;
  border-radius: var(--md2-radius-card);
  color: var(--md2-text-primary);
  font-size: 14px;
}

form {
  display: grid;
  gap: 16px;
}

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

.form-grid-3 {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
}

/* input.php — compacte kenmerken-checkboxes */
#nieuw-product .product-kenmerken-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 12px;
}

#nieuw-product .product-kenmerken-legend {
  font-size: 11px;
  font-weight: 500;
  padding: 0;
  margin: 0 0 6px;
  letter-spacing: 0.35px;
}

#nieuw-product .product-kenmerken-hint {
  font-weight: 400;
  opacity: 0.88;
}

#nieuw-product .product-kenmerken-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.3;
}

#nieuw-product .product-kenmerk-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}

#nieuw-product .product-kenmerk-row input[type="checkbox"],
#nieuw-product .product-kenmerk-row input[type="radio"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--md2-primary);
}

#nieuw-product .product-kenmerk-desc {
  font-size: 11px;
  line-height: 1.25;
}

/* Dashboard: snel invoeren — meerdere productregels + zoekveld */
.quick-usage-line {
  margin-bottom: 12px;
}

.quick-usage-line-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 12px 16px;
  align-items: end;
}

.quick-product-wrap {
  position: relative;
}

.quick-product-search {
  width: 100%;
}

.quick-line-actions {
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

#quick-usage-lines .quick-ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 80;
}

@media (max-width: 720px) {
  .quick-usage-line-grid {
    grid-template-columns: 1fr;
  }

  .quick-line-actions {
    justify-content: flex-start;
    padding-bottom: 0;
  }
}

/* Tabellen: klikbare kolomkoppen (public/js/table-sort.js) */
.js-sortable-table thead th.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.js-sortable-table thead th.th-sortable:hover {
  color: var(--md2-primary);
}
.js-sortable-table thead th.th-sortable:focus {
  outline: 2px solid var(--md2-primary);
  outline-offset: 2px;
}
.js-sortable-table thead th.th-sortable[aria-sort="ascending"]::after {
  content: ' \2191';
  opacity: 0.75;
  font-size: 0.85em;
  font-weight: 600;
}
.js-sortable-table thead th.th-sortable[aria-sort="descending"]::after {
  content: ' \2193';
  opacity: 0.75;
  font-size: 0.85em;
  font-weight: 600;
}
.product-overview-row--inactive {
  opacity: 0.78;
}

/* Bulk-selectie boven tabellen (products.php, voorraad.php): select niet 100% breed; vinkjes 15px */
form.table-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 1rem 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--md2-radius-card, 8px);
}

form.table-bulk-toolbar label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: auto;
  max-width: 100%;
  margin: 0;
}

form.table-bulk-toolbar select {
  width: auto;
  min-width: 220px;
  max-width: min(100%, 28rem);
}

.products-beheer-table input[type="checkbox"],
.voorraad-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 4px;
  box-shadow: none;
  accent-color: var(--md2-primary);
  vertical-align: middle;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.4px;
  color: var(--md2-text-secondary);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--md2-divider);
  background: transparent;
  color: var(--md2-text-primary);
  border-radius: var(--md2-radius-field) var(--md2-radius-field) 0 0;
  padding: 8px 0 8px 0;
  min-height: 48px;
  font-size: 16px;
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
  min-height: 96px;
  border: 1px solid var(--md2-divider);
  border-radius: var(--md2-radius-field);
  padding: 12px;
}

input:hover,
select:hover,
textarea:hover {
  border-bottom-color: var(--md2-text-primary);
}

textarea:hover {
  border-color: var(--md2-text-primary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-bottom: 2px solid var(--md2-primary);
  margin-bottom: -1px;
  box-shadow: none;
}

textarea:focus {
  border: 2px solid var(--md2-primary);
  padding: 11px;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: var(--md2-text-disabled);
  border-bottom-style: dotted;
  cursor: not-allowed;
}

textarea:disabled {
  border: 1px dashed var(--md2-divider);
}

.actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* MD2 raised / contained button */
button {
  border: 0;
  background: var(--md2-primary);
  color: #fff;
  border-radius: var(--md2-radius-btn);
  padding: 0 16px;
  cursor: pointer;
  min-height: 36px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  box-shadow: var(--md2-elevation-2);
  transition: background-color 0.15s, box-shadow 0.15s;
}

button:hover {
  background: var(--md2-primary-dark);
  box-shadow: var(--md2-elevation-4);
  transform: none;
}

button:focus-visible {
  outline: 2px solid var(--md2-primary);
  outline-offset: 2px;
}

button:active {
  box-shadow: var(--md2-elevation-1);
}

button.secondary:hover,
button.ghost:hover {
  transform: none;
}

/* MD2 flat button (secondary) */
button.secondary {
  background: transparent;
  color: var(--md2-primary);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(var(--md2-primary-rgb), 0.08);
  box-shadow: none;
}

/* MD2 outline */
button.ghost {
  background: transparent;
  color: var(--md2-primary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(var(--md2-primary-rgb), 0.06);
  box-shadow: none;
}

button.danger {
  background: var(--md2-error);
  color: #fff;
  box-shadow: var(--md2-elevation-2);
}

button.danger:hover {
  background: #9b0018;
  box-shadow: var(--md2-elevation-4);
}

button.small {
  padding: 0 12px;
  min-height: 32px;
  font-size: 13px;
  border-radius: var(--md2-radius-btn);
}

a.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  border-radius: var(--md2-radius-btn);
  padding: 0 16px;
  min-height: 36px;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
}

a.btn-link.secondary {
  background: transparent;
  color: var(--md2-primary);
  border: 0;
}

a.btn-link.ghost {
  background: transparent;
  color: var(--md2-primary);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

a.btn-link:hover {
  transform: none;
}

a.btn-link.secondary:hover {
  background: rgba(var(--md2-primary-rgb), 0.08);
}

a.btn-link.ghost:hover {
  background: rgba(var(--md2-primary-rgb), 0.06);
}

#product-import-result {
  margin-top: 12px;
  font-size: 14px;
}

.summary-card {
  padding: 16px;
  border-radius: var(--md2-radius-card);
  background: var(--md2-surface);
  border: none;
  box-shadow: var(--md2-elevation-2);
}

.summary-card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--md2-text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
}

.summary-card .value {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 400;
  margin-bottom: 4px;
  color: var(--md2-text-primary);
}

.summary-card .sub {
  font-size: 14px;
  color: var(--md2-text-secondary);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(var(--md2-primary-rgb), 0.12);
  color: var(--md2-primary-dark);
  white-space: nowrap;
  letter-spacing: 0.4px;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--md2-radius-card);
  background: var(--md2-surface);
  box-shadow: var(--md2-elevation-2);
}

.table-wrap.compact table {
  min-width: 560px;
}

.section-stack {
  display: grid;
  gap: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: var(--md2-surface);
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--md2-divider);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: #fafafa;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--md2-text-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

tr.report-parent {
  cursor: pointer;
  transition: background-color 0.15s;
}

tr.report-parent:hover {
  background: rgba(var(--md2-primary-rgb), 0.04);
}

tr.report-parent.is-open {
  background: rgba(var(--md2-primary-rgb), 0.08);
}

tr.report-parent .report-chevron {
  display: inline-block;
  width: 1.25rem;
  color: var(--md2-primary);
  font-size: 0.75rem;
}

td.report-detail-cell {
  padding: 0 !important;
  background: #fafafa;
  border-bottom: 1px solid var(--md2-divider);
  vertical-align: top;
}

.report-nested {
  margin: 0;
  min-width: 640px;
  background: var(--md2-surface);
}

.report-nested th {
  background: #eeeeee;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 24px;
  color: var(--md2-text-secondary);
  text-align: center;
  border: 1px dashed var(--md2-divider);
  border-radius: var(--md2-radius-card);
  background: var(--md2-surface);
}

.status-low {
  color: var(--md2-error);
  font-weight: 500;
}
.status-ok {
  color: var(--good);
  font-weight: 500;
}
.status-mid {
  color: var(--warn);
  font-weight: 500;
}

.footer-text {
  color: var(--md2-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.inline-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--md2-text-secondary);
  font-size: 14px;
}

.purchase-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
}

.detail-backdrop[hidden] {
  display: none !important;
}

.detail-panel {
  background: var(--md2-surface);
  border-radius: var(--md2-radius-card);
  border: none;
  box-shadow: var(--md2-elevation-8);
  max-width: 720px;
  width: 100%;
  padding: 24px;
  margin-top: 20px;
  margin-bottom: 40px;
}

.detail-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}

.detail-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 16px 0;
}

@media (max-width: 560px) {
  .detail-kv {
    grid-template-columns: 1fr;
  }
}

.detail-kv div {
  padding: 12px 16px;
  background: #fafafa;
  border-radius: var(--md2-radius-card);
  border: 1px solid var(--md2-divider);
}

.detail-kv .k {
  font-size: 12px;
  font-weight: 500;
  color: var(--md2-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.detail-kv .v {
  font-weight: 400;
  font-size: 14px;
}

.purchase-buyer-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--md2-divider);
}

.purchase-buyer-block h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 500;
}

.purchase-balance-card {
  margin-top: 20px;
  padding: 20px;
  background: var(--md2-surface);
  border-radius: var(--md2-radius-card);
  box-shadow: var(--md2-elevation-1);
}

.purchase-balance-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.balance-chart-row {
  margin-bottom: 16px;
}

.balance-chart-row:last-child {
  margin-bottom: 0;
}

.balance-chart-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--md2-text-primary);
}

.balance-chart-label small {
  font-weight: 400;
  color: var(--md2-text-secondary);
  font-size: 13px;
}

.balance-bar-track {
  height: 24px;
  border-radius: 2px;
  background: #eeeeee;
  border: none;
  overflow: hidden;
  display: flex;
}

.balance-bar-seg {
  height: 100%;
  min-width: 0;
  transition: width 0.25s ease;
}

.balance-bar-verbruik {
  background: var(--md2-primary);
}

.balance-bar-restant {
  background: var(--md2-primary-light);
}

.balance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--md2-text-secondary);
}

.balance-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.balance-legend i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pair-diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.pair-diff-item {
  padding: 16px;
  background: var(--md2-surface);
  border-radius: var(--md2-radius-card);
  border: 1px solid var(--md2-divider);
  font-size: 14px;
}

.pair-diff-item strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--md2-text-secondary);
  margin-bottom: 4px;
}

@media (max-width: 980px) {
  .grid-2,
  .grid-4,
  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100% !important;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px;
    gap: 4px;
    box-shadow: var(--md2-elevation-1);
  }
  .sidebar.collapsed {
    width: 100% !important;
  }
  .sidebar-brand {
    border-bottom: 0;
    margin-bottom: 0;
    padding: 4px 8px;
    flex: 1;
  }
  .sidebar nav {
    display: flex;
    flex-wrap: wrap;
    flex: 1;
    gap: 4px;
  }
  .nav-link {
    margin: 0 4px;
    min-height: 40px;
    padding: 0 12px;
  }
  .sidebar.collapsed .nav-link span.nav-label {
    display: inline;
  }
}
