:root {
  color-scheme: light;
  --background: #f7f5fa;
  --surface: #ffffff;
  --ink: #271933;
  --muted: #665b70;
  --line: #e9e1ee;
  --purple: #66267f;
  --magenta: #931e81;
  --tint: #f3e8f7;
  --danger: #9c2643;
  --danger-bg: #faeaf0;
  --warn: #815113;
  --warn-bg: #f9eedb;
  --ok: #285f52;
  --ok-bg: #e7f3ed;
  --shadow: 0 4px 18px #3e184709;
  font: 16px/1.5 "Aptos", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #a751bd; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .6; }
h1, h2, h3, p { margin: 0; }
small { font-size: .8125rem; }
.icon { display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: middle; }
.skip-link { position: absolute; top: 10px; left: 10px; z-index: 5; padding: 10px; background: white; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { background: #fff; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 17px 14px; }
.brand { display: block; padding: 0 1px; margin: 3px 0 22px; }
.brand img { display: block; width: 100%; height: auto; }
#mobile-menu { display: none; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-label { padding-left: 12px; margin-bottom: 7px; font-size: .75rem; font-weight: 750; letter-spacing: .095em; text-transform: uppercase; color: var(--muted); }
.nav-link { display: flex; gap: 10px; align-items: center; padding: 10px 12px; min-height: 43px; margin: 2px 0; border-radius: 8px; color: #584763; font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.nav-link .icon { width: 18px; height: 18px; }
.nav-link:hover { background: #f8f2fa; color: var(--purple); }
.nav-link[aria-current="page"] { background: var(--tint); color: var(--purple); box-shadow: inset 3px 0 var(--purple); font-weight: 750; }
.sidebar-footer { display: flex; align-items: center; gap: 11px; margin: auto 1px 3px; padding: 11px 10px; background: #f8f4fa; border: 1px solid var(--line); border-radius: 9px; }
.sidebar-footer .icon { color: var(--purple); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: .875rem; }
.sidebar-footer small { color: var(--muted); }

.workspace { min-width: 0; }
.topbar { height: 62px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar-path, .topbar-date { display: flex; gap: 10px; align-items: center; font-size: .875rem; color: var(--muted); }
.topbar-path strong { color: var(--ink); }
.separator { color: #9d8da6; }
.topbar-date .icon { width: 17px; height: 17px; color: var(--purple); }
.topbar-actions, .topbar-account { display: flex; align-items: center; gap: 13px; }
.topbar-account { padding-left: 13px; border-left: 1px solid var(--line); }
.topbar-account > span { color: var(--purple); font-size: .875rem; font-weight: 700; }
main { max-width: 1500px; padding: 24px 32px 44px; margin: 0 auto; outline: none; }
main > * + * { margin-top: 20px; }

.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 224px; padding: 29px 32px; border-radius: 15px; color: white; background: linear-gradient(110deg, #351449 0%, #612375 59%, #8e237b 100%); }
.hero-copy { position: relative; z-index: 1; }
.hero-kicker { color: #f3c9f6; font-weight: 700; font-size: .8125rem; letter-spacing: .09em; text-transform: uppercase; }
.hero h1 { margin: 3px 0 4px; font-size: clamp(2rem, 4vw, 2.85rem); letter-spacing: -.055em; line-height: 1.13; font-weight: 770; }
.hero p { color: #f5def7; max-width: 37em; }
.hero .actions { margin-top: 17px; }
.hero-art { position: absolute; inset: 0 0 0 auto; width: 39%; pointer-events: none; overflow: hidden; }
.hero-art::before { content: ""; position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(#eab2ee30 1px, transparent 1px), linear-gradient(90deg, #eab2ee30 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(90deg, transparent, black 23%); }
.emblem { position: absolute; top: 50%; right: 29%; transform: translate(25%, -50%); width: 164px; height: 164px; border-radius: 50%; background: url("logo-de-wijngaard.png") -36px -36px / 622px auto no-repeat; box-shadow: 0 0 0 1px #fce2fb66, 0 0 0 16px #f9d9fa13, 0 0 0 17px #f9d9fa32, 0 0 0 41px #f9d9fa0d, 0 0 0 42px #f9d9fa24, 0 15px 35px #2d0e43a0; }
.hero-art .pin { position: absolute; left: 25%; top: 31%; width: 9px; height: 9px; border: 1px solid #f8d9fb; border-radius: 50%; box-shadow: 0 0 0 5px #f8d9fb30; }
.hero-art .pin + .pin { left: auto; right: 12%; top: 72%; width: 7px; height: 7px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button { min-height: 41px; display: inline-flex; gap: 8px; justify-content: center; align-items: center; border-radius: 8px; border: 1px solid var(--line); padding: 7px 13px; color: var(--purple); background: #fff; font-size: .875rem; font-weight: 750; }
.button .icon { width: 17px; height: 17px; }
.button:hover { background: #f7effa; border-color: #dac6e3; }
.button.primary { background: var(--purple); border-color: var(--purple); color: white; }
.button.primary:hover { background: #512065; }
.button.hero-primary { border-color: white; }
.button.hero-secondary { background: #ffffff15; color: white; border-color: #ffffff55; }
.button.hero-secondary:hover { background: #ffffff25; }
.button.compact { min-height: 35px; padding: 5px 10px; }
.text-button { border: 0; background: none; padding: 4px 0; color: var(--purple); font-size: .875rem; font-weight: 750; }
.text-button:hover { text-decoration: underline; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric { display: flex; flex-direction: column; position: relative; padding: 14px 15px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.metric:hover { border-color: #c6a7d4; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 9px; border-radius: 9px; color: var(--purple); background: var(--tint); }
.metric-icon.danger { color: var(--danger); background: var(--danger-bg); }
.metric-icon.warn { color: var(--warn); background: var(--warn-bg); }
.metric-icon.ok { color: var(--ok); background: var(--ok-bg); }
.metric-label { font-size: .875rem; color: var(--muted); font-weight: 670; }
.metric-value { font-size: 1.95rem; font-weight: 770; line-height: 1.1; letter-spacing: -.04em; margin: 2px 0 4px; }
.metric small { color: var(--muted); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--surface); border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 7px 12px; padding: 17px 17px 13px; }
.panel-heading h2 { font-size: 1.125rem; line-height: 1.2; letter-spacing: -.025em; }
.panel-heading p { font-size: .875rem; color: var(--muted); margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.mobile-table-label { display: none; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th, td { padding: 10px 13px; border-top: 1px solid #eee8f1; vertical-align: middle; }
th { font-size: .8125rem; color: var(--muted); background: #faf8fb; font-weight: 730; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
tbody tr:hover { background: #fdfaff; }
.row-link { border: 0; background: none; color: var(--ink); font-weight: 730; padding: 0; text-align: left; line-height: 1.3; }
.row-link:hover { color: var(--purple); text-decoration: underline; }
.subline { display: block; color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; padding: 3px 7px; border-radius: 5px; font-size: .8125rem; font-weight: 740; color: var(--purple); background: var(--tint); white-space: nowrap; }
.tag.danger { color: var(--danger); background: var(--danger-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.neutral { color: #5d5265; background: #eee9f1; }
.late { color: var(--danger); font-weight: 700; }
.empty { padding: 23px 17px; color: var(--muted); }
.timeline { margin: 0; padding: 0 17px 5px; list-style: none; }
.timeline li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line); }
.date-tile { display: grid; justify-items: center; border-radius: 7px; background: #f4ebf8; color: var(--purple); line-height: 1; padding: 6px 0; }
.date-tile strong { font-size: 1.125rem; }
.date-tile small { font-size: .6875rem; font-weight: 750; text-transform: uppercase; margin-top: 3px; }
.report-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 14px 13px; gap: 9px; }
.report-card { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--purple); min-width: 0; }
.report-card:hover { border-color: #c6a7d4; }
.report-card strong { color: var(--ink); font-size: .875rem; display: block; line-height: 1.2; }

.page-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 10px; padding: 6px 0 3px; }
.page-heading h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); letter-spacing: -.045em; line-height: 1.11; }
.page-heading p { color: var(--muted); margin-top: 5px; }
.pending-source { display: flex; align-items: flex-start; gap: 12px; padding: 19px; }
.pending-source .metric-icon { margin: 0; flex: 0 0 34px; }
.pending-source h2 { font-size: 1.125rem; line-height: 1.3; }
.pending-source p { color: var(--muted); margin-top: 4px; }
.asset-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; padding: 14px 17px; }
.filters input { max-width: 350px; flex: 1 1 220px; }
input, textarea, select { min-width: 0; min-height: 41px; color: var(--ink); border: 1px solid #d8cddd; border-radius: 7px; padding: 7px 9px; background: white; }
select { appearance: none; padding-right: 27px; background: linear-gradient(45deg, transparent 50%, var(--purple) 51%) right 13px center / 5px 5px no-repeat, linear-gradient(135deg, var(--purple) 50%, transparent 51%) right 8px center / 5px 5px no-repeat, white; }
textarea { resize: vertical; min-height: 78px; }
.list-table { min-width: 635px; }

dialog { position: fixed; max-height: calc(100dvh - 30px); width: min(575px, calc(100vw - 26px)); padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 70px #27133344; }
dialog::backdrop { background: #25102d76; }
.dialog-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.375rem; line-height: 1.16; letter-spacing: -.025em; }
.dialog-head p { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.icon-button { border-radius: 7px; min-width: 34px; height: 34px; background: #f8f2fa; color: var(--purple); border: 1px solid var(--line); display: grid; place-items: center; }
.icon-button:hover { background: var(--tint); }
.dialog-body { padding: 16px 20px 19px; }
.dialog-body > * + * { margin-top: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.fields, .details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.full { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; font-weight: 690; font-size: .875rem; }
.field > :is(input, select, textarea) { width: 100%; font-weight: 400; font-size: .9375rem; }
.details-grid { margin-block: 0; }
.details-grid div { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
dt { color: var(--muted); font-size: .8125rem; }
dd { margin: 1px 0 0; font-size: .9375rem; overflow-wrap: anywhere; }
.history { margin: 5px 0 0; padding-left: 21px; font-size: .875rem; }
.history button { color: var(--purple); }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 630; font-size: .875rem; }
.checkline[hidden] { display: none; }
.checkline input { min-height: auto; accent-color: var(--purple); }
.record-section h3, .form-section legend { margin-bottom: 5px; font-size: 1rem; font-weight: 750; }
.form-section { min-width: 0; margin-inline: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 8px; }
.form-section legend { padding-inline: 4px; }
.form-section > .subline { margin-top: 7px; }
.interval-section [hidden] { display: none; }
.interval-summary { padding: 9px 11px; background: #f8f2fa; border-radius: 8px; }
.interval-section .interval-summary { margin-top: 9px; }
.interval-metrics { display: flex; flex-wrap: wrap; gap: 3px 12px; align-items: baseline; }
.interval-metrics span { color: var(--purple); font-weight: 670; font-size: .875rem; }
#k1-plan { margin-top: 8px; }
#k1-report-advice .button { margin-top: 7px; }
.inspection-section { padding-top: 4px; background: #fcf9fd; }
.form-section > .inspection-intro { margin: 0 0 6px; }
.inspection-check { min-height: 36px; padding: 4px 0; }
.inspection-check input { width: 18px; height: 18px; margin: 0; flex: 0 0 18px; }
.inspection-check input:disabled { opacity: .73; }
.inspection-measure { padding: 1px 0 6px 26px; }
.inspection-measure input { max-width: 12rem; }
.inspection-group { margin-block: 5px; padding: 5px 0 3px; border-block: 1px solid var(--line); }
.inspection-group h3 { font-size: .875rem; margin: 0 0 2px; }
.form-section > .inspection-hint { margin: -1px 0 3px 26px; }
.inspection-outcome { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 5px; padding-top: 8px; border-top: 1px solid var(--line); }
.check-results { margin: 0; padding: 0; list-style: none; }
.check-results li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.notice { position: fixed; z-index: 5; right: 20px; bottom: 20px; display: none; max-width: calc(100vw - 40px); padding: 10px 15px; border-radius: 8px; background: #382047; color: white; box-shadow: var(--shadow); }
.notice.active { display: block; }

.account-page { min-height: 100dvh; background: radial-gradient(ellipse at 50% 2%, #f0dff5, transparent 60%), var(--background); }
.account-layout { display: grid; align-content: start; justify-items: center; max-width: 32rem; padding: clamp(20px, 7vh, 74px) 18px 28px; }
.account-logo { display: block; width: min(315px, 100%); height: auto; }
.account-card { width: 100%; background: var(--surface); padding: clamp(19px, 5vw, 32px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 50px #3e184714; }
.account-context { color: var(--purple); font-size: .875rem; font-weight: 700; }
.account-card h1 { margin: 1px 0 0; font-size: clamp(1.7rem, 7vw, 2.25rem); line-height: 1.16; letter-spacing: -.044em; }
.account-intro { margin-top: 7px; color: var(--muted); }
.account-form { display: grid; gap: 13px; margin-top: 17px; }
.account-form .subline { margin-top: -8px; }
.account-form button { margin-top: 4px; }
.account-error { margin-top: 10px; border-radius: 7px; padding: 8px 10px; background: var(--danger-bg); color: var(--danger); }

@media (min-width: 1450px) { main { padding-inline: 42px; } }
@media (max-width: 1110px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  main, .topbar { padding-inline: 20px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .dashboard-grid th, .dashboard-grid td { padding-inline: 8px; }
  .dashboard-grid :is(th, td):first-child { padding-left: 13px; }
  .hero-art { width: 34%; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { height: auto; z-index: 2; padding: 5px 13px 4px; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 169px; margin: 0; }
  .sidebar nav { display: flex; gap: 5px; overflow-x: auto; }
  .nav-group { display: flex; gap: 3px; }
  .nav-group + .nav-group { margin: 0; }
  .nav-label, .sidebar-footer { display: none; }
  .nav-link { margin: 0; padding: 7px 9px; min-height: 36px; font-size: .875rem; gap: 6px; }
  .nav-link .icon { width: 16px; height: 16px; }
  .topbar { height: 45px; }
}
@media (max-width: 650px) {
  .sidebar { position: sticky; top: 0; z-index: 4; }
  .sidebar-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  #mobile-menu { display: inline-flex; }
  #mobile-menu[aria-expanded="true"] { background: var(--tint); border-color: #dac6e3; }
  .sidebar nav { display: none; }
  .sidebar nav.mobile-open { display: block; max-height: 65dvh; overflow: auto; padding: 4px 1px 9px; }
  .nav-group { display: block; }
  .nav-group + .nav-group { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
  .nav-link { min-height: 44px; font-size: .9375rem; }
  main { padding: 13px 12px 28px; }
  main > * + * { margin-top: 13px; }
  .topbar { height: 51px; padding-inline: 12px; gap: 4px; }
  .topbar-path, .topbar-date { font-size: .8125rem; gap: 5px; }
  .topbar-date .icon { display: none; }
  .topbar-actions, .topbar-account { gap: 7px; }
  .topbar-account { padding-left: 7px; border-left: 0; }
  .topbar-account > span, .topbar-date { display: none; }
  .hero { padding: 19px 15px; min-height: 0; }
  .hero-art { width: 46%; opacity: .27; }
  .hero .actions { margin-top: 13px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 10px; }
  .metric-value { font-size: 1.7rem; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .report-strip { grid-template-columns: minmax(0, 1fr); }
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody { display: block; min-width: 0; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .table-wrap tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 10px 15px 12px;
    border-top: 1px solid var(--line);
  }
  .table-wrap td, .table-wrap tbody td:first-child, .table-wrap tbody td:last-child {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .table-wrap td:first-child { grid-column: 1 / -1; }
  .mobile-table-label { display: block; color: var(--muted); font-size: .8125rem; font-weight: 650; }
  td:first-child .mobile-table-label { display: none; }
  .table-wrap .row-link { display: inline-flex; align-items: center; max-width: 100%; font-size: 1rem; }
  .button, .button.compact, .row-link, .checkline, input:not([type="checkbox"]), select, .icon-button { min-height: 44px; }
  .icon-button { min-width: 44px; }
  .field > :is(input, select, textarea), .filters > :is(input, select) { font-size: 1rem; }
  .dialog-head, .dialog-body { padding-inline: 14px; }
  .dialog-body .fields { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .shell, .notice, .dialog-foot, .icon-button { display: none !important; }
  dialog[open] { all: unset; display: block; }
  dialog::backdrop { display: none; }
  .record-section, .check-results li { break-inside: avoid; }
}
