/* Opname-app — huisstijl Aannemersbedrijf Treijtel.
   Tokens overgenomen uit het Treijtel Design System (tokens/*.css);
   componentmaten uit de themastylesheet van treijtel.nl. */

/* ─── Fonts (zelf gehost, zie DS "Openstaande punten" 1) ────────────────── */
@font-face { font-family: "Source Sans Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-sans-pro-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans Pro"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/source-sans-pro-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-sans-pro-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/source-sans-pro-latin-700-normal.woff2") format("woff2"); }

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --blue-700: #004598;
  --blue-600: #005ccb;
  --blue-100: rgb(0 69 152 / 0.2);
  --green-500: #84e92d;
  --green-400: #9fee5b;
  --green-600: #71c03d;
  --green-300: #9bd376;
  --red-600: #c40000;
  --red-500: #ff1212;
  --amber-400: #f7ba45;
  --black: #000;
  --ink-800: #313439;
  --ink-600: #58585b;
  --grey-500: #878787;
  --grey-300: #ddd;
  --grey-250: #e0e1e1;
  --grey-200: #e8e8e8;
  --grey-100: #f6f7f9;
  --white: #fff;

  --text-body: var(--black);
  --text-muted: var(--grey-500);
  --text-label: var(--ink-800);
  --surface-page: var(--grey-100);
  --surface-card: var(--white);
  --surface-brand: var(--blue-700);
  --border-default: var(--grey-300);
  --border-strong: var(--grey-200);
  --border-focus: var(--blue-700);
  --action-primary: var(--blue-700);
  --action-primary-hover: var(--blue-600);
  --action-secondary: var(--green-500);
  --action-secondary-hover: var(--green-400);
  --state-success: var(--green-600);
  --state-error: var(--red-600);
  --state-warning: var(--amber-400);
  --banner-scrim: rgb(0 0 0 / 0.25);

  --font-sans: "Source Sans Pro", "Segoe UI", Helvetica, Arial, sans-serif;
  --text-base: 20px;
  --leading-base: 1.6;
  --leading-heading: 1.4;
  --h1-sm: 34px;
  --h2-sm: 27px;
  --text-button: 15px;
  --text-button-lg: 19px;
  --text-form-label: 19px;
  --text-input: 20px;
  --text-card-title: 20px;
  --text-label: 13px;
  --text-label-big: 14px;
  --text-nav: 16px;
  --tracking-upper: 0.04em;

  --flow-block: 30px;
  --flow-block-sm: 20px;
  --flow-tight: 10px;
  --gap-1: 10px;
  --gap-2: 20px;
  --gap-3: 30px;
  --gutter: 20px;
  --header-height: 70px;
  --card-padding: 20px;

  --radius-button: 2px;
  --radius-input: 0;
  --radius-label: 4px;
  --radius-badge: 5px;
  --radius-card: 10px;
  --shadow-card: 0 10px 15px rgb(0 0 0 / 0.2);
  --shadow-raised: 0 1px 3px rgb(0 0 0 / 0.3);
  --shadow-float: 0 4px 30px rgb(0 0 0 / 0.15);
  --shadow-bar: -1px 1px 5px rgb(0 0 0 / 0.15);
  --duration: 300ms;
  --duration-fast: 200ms;
  --ease: ease-in;
  --hover-opacity: 0.7;
  --disabled-opacity: 0.7;
}
@media (min-width: 600px) { :root { --card-padding: 30px; } }
@media (min-width: 1024px) { :root { --header-height: 95px; } }

/* ─── Basis ──────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--text-body);
  background: var(--surface-page);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 400; text-transform: none; line-height: var(--leading-heading); margin: 0; }
h1 { font-size: var(--h1-sm); }
h2 { font-size: var(--h2-sm); }
h3 { font-size: 20px; }
p { margin: 0; }
p + p { margin-top: var(--flow-block-sm); }
a { color: var(--blue-700); transition: color var(--duration-fast) var(--ease); }
a:hover { color: var(--blue-600); }
small { font-size: var(--text-nav); }
.muted { color: var(--text-muted); }
p.muted { font-size: var(--text-nav); line-height: 1.5; }
.card h2 + p.muted, .card h2 + p { margin-top: 4px; }

/* Iconen: inline SVG-sprite, altijd naast tekst, 10px van de tekst. */
.ic { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }

/* ─── Vaste kop ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--header-height) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--white);
  box-shadow: var(--shadow-bar);
  display: flex; align-items: center; gap: var(--gap-1);
  padding-left: var(--gutter); padding-right: var(--gutter);
}
.topbar .logo { height: 40px; width: auto; display: block; }
@media (min-width: 1024px) { .topbar .logo { height: 58px; } }
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-height: 0; margin-left: -12px; padding: 0;
  background: none; border: 0; cursor: pointer;
  color: var(--blue-700); border-radius: var(--radius-button);
}
.icon-btn:hover { color: var(--blue-600); background: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-nav); color: var(--blue-700); text-decoration: none;
  max-width: 34vw; white-space: nowrap; overflow: hidden;
}
.user-chip span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .user-chip span { display: none; } }

/* Statuslabel (DS Label) */
.label, .ai-badge {
  display: inline-block; vertical-align: middle;
  font-size: var(--text-label); font-weight: 500; line-height: 18px;
  padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-label);
  background: var(--grey-250); color: var(--black); white-space: nowrap;
}
.label.success, .ai-badge.on { background: var(--state-success); color: var(--white); }
.label.warning, .ai-badge.off { background: var(--state-warning); color: var(--black); }
.label.error { background: var(--state-error); color: var(--white); }

/* ─── Pagina ─────────────────────────────────────────────────────────────── */
#app { max-width: 720px; margin: 0 auto; padding: var(--gap-2) var(--gutter) 60px; }
.page-title { margin: 0 0 var(--gap-2); }
.page-title:empty { display: none; }
.page-sub { margin: -14px 0 var(--gap-2); font-size: var(--text-nav); color: var(--ink-600); }

/* Kaart: witte tekstplaat, 10px radius, diepe schaduw, geen rand. */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  margin-top: var(--gap-2);
  word-break: break-word;
}
.view > :first-child { margin-top: 0; }
.card h2, .card-title { font-size: var(--text-card-title); font-weight: 700; line-height: var(--leading-heading); }
.card h2 + .btn, .card h2 + button, .card h2 + .camera-btn, .card h2 + .defect-photo { margin-top: var(--flow-tight); }
.card > .btn + .btn, .card > button + button, .card > .camera-btn + button, .card > .row + .row { margin-top: var(--flow-tight); }
.card > .row { margin-top: var(--flow-block-sm); }

/* ─── Formulieren ────────────────────────────────────────────────────────── */
label { display: block; margin-top: var(--flow-block-sm); font-size: var(--text-form-label); font-weight: 600; color: var(--text-label); line-height: 1.4; }
label > input, label > textarea, label > select, label > .row { margin-top: 4px; font-weight: 400; }
.hint { display: block; margin-top: 4px; font-size: var(--text-nav); font-weight: 400; color: var(--text-muted); }

input[type="text"], input[type="search"], input[type="number"], textarea, select {
  display: block; width: 100%;
  font-family: inherit; font-weight: 400; font-size: var(--text-input);
  color: var(--text-body); background: var(--white);
  border: 1px solid var(--border-default); border-radius: var(--radius-input);
  box-shadow: none; outline: none;
  height: 56px; padding: 0 16px;
  transition: border-color var(--duration-fast) var(--ease);
}
textarea { height: auto; padding: 12px 16px; line-height: var(--leading-base); resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input::placeholder, textarea::placeholder { color: var(--grey-500); }
input:focus, textarea:focus, select:focus { border-color: var(--border-focus); }
input:disabled, textarea:disabled, select:disabled { opacity: var(--disabled-opacity); font-style: italic; cursor: not-allowed; }
input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--blue-700); flex-shrink: 0; }

.row { display: flex; gap: var(--gap-1); align-items: stretch; }
.row > label { margin-top: 0; }
.grow { flex: 1; min-width: 0; }

/* ─── Knoppen ────────────────────────────────────────────────────────────── */
button, .btn {
  font-family: inherit; font-weight: 600; font-size: var(--text-button);
  line-height: var(--leading-base); text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 24px;
  border: 0 solid transparent; border-radius: var(--radius-button);
  background: var(--action-primary); color: var(--white);
  cursor: pointer; -webkit-appearance: none;
  transition: background-color var(--duration) var(--ease), opacity var(--duration) var(--ease), color var(--duration) var(--ease);
}
button:disabled { opacity: var(--disabled-opacity); cursor: not-allowed; }
.primary { background: var(--action-primary); color: var(--white); }
.primary:hover, .primary:active { background: var(--action-primary-hover); }
/* Groene knop: alleen als tweede actie in een blok (DS). */
.accent { background: var(--action-secondary); color: var(--white); }
.accent:hover, .accent:active { background: var(--action-secondary-hover); }
/* Lijnknop: de neutrale actie. */
.secondary { background: none; color: var(--action-primary); border: 2px solid var(--action-primary); }
.secondary:hover, .secondary:active { opacity: 0.6; }
.danger { background: var(--state-error); color: var(--white); }
.danger:hover, .danger:active { opacity: var(--hover-opacity); }
.big { width: 100%; min-height: 56px; font-size: var(--text-button-lg); padding: 12px 20px; }
.view > .big + .big, .view > .card + .big, .view > .big + .card, .view > .report + .big, .view > .big + .row, .view > .row + .row, .view > .big + .ai-progress, .view > .ai-progress + .card { margin-top: var(--flow-tight); }
.view > .card + .row, .view > .report + .row { margin-top: var(--gap-2); }
.icon-only { padding: 0; width: 56px; min-width: 56px; }
.camera-btn { cursor: pointer; margin-top: 0; }

.spinner {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid var(--grey-300); border-top-color: var(--blue-700);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.spinner.small { width: 14px; height: 14px; }
.primary .spinner, .danger .spinner, .accent .spinner { border-color: rgb(255 255 255 / 0.4); border-top-color: var(--white); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Meldingen ──────────────────────────────────────────────────────────── */
.ai-note, .ai-progress, .login-msg {
  margin-top: var(--flow-tight);
  padding: 10px 14px; border-radius: var(--radius-label);
  background: var(--grey-100); color: var(--text-body);
  border-left: 4px solid var(--blue-700);
  font-size: var(--text-nav); line-height: 1.5;
}
.ai-note.ok { border-left-color: var(--state-success); }
.ai-note.warn { border-left-color: var(--state-warning); }
.ai-note.error, .login-msg.error { border-left-color: var(--state-error); }
.ai-progress { display: flex; align-items: center; gap: 10px; }

/* ─── Lijsten ────────────────────────────────────────────────────────────── */
.room-list, .defect-list { list-style: none; padding: 0; margin: var(--flow-tight) 0 0; }
.room-list li {
  display: flex; justify-content: space-between; align-items: center; gap: var(--gap-1);
  min-height: 56px; padding: 8px 0;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer; transition: color var(--duration-fast) var(--ease);
}
.room-list li:hover, .room-list li:active { color: var(--blue-700); }
.room-list li > span:first-child { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.room-list small { color: var(--text-muted); }
.room-list .muted-ic { color: var(--text-muted); vertical-align: -3px; }
.card h2 small { font-size: var(--text-label-big); font-weight: 400; margin-left: 6px; }
.room-list .row-end { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.room-list .icon-btn.del { margin: 0 -10px 0 0; color: var(--text-muted); }
.room-list .icon-btn.del:hover, .room-list .icon-btn.del:active { color: var(--state-error); }
.badge { display: inline-block; font-size: var(--text-label-big); font-weight: 500; line-height: 20px; padding: 0 10px; border-radius: var(--radius-badge); background: var(--blue-100); color: var(--blue-700); white-space: nowrap; }
.badge.zero { background: var(--grey-250); color: var(--ink-600); }

.defect-list li { display: flex; gap: var(--gap-1); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-default); }
.defect-list img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-badge); flex-shrink: 0; }
.defect-list .info { flex: 1; min-width: 0; }
.defect-list .info p { margin: 0; font-size: var(--text-nav); line-height: 1.4; }
.defect-list .info small { color: var(--text-muted); font-size: var(--text-label-big); }
.del, .f-del, .cl-del { background: none; border: 0; color: var(--red-600); cursor: pointer; min-height: 44px; width: 44px; padding: 0; }
.del:hover, .f-del:hover, .cl-del:hover { opacity: var(--hover-opacity); background: none; }
.thumb-mic { width: 64px; height: 64px; border-radius: var(--radius-badge); flex-shrink: 0; background: var(--grey-100); color: var(--blue-700); display: flex; align-items: center; justify-content: center; }
.finding-card .thumb-mic { width: 72px; height: 56px; }
.thumb-mic.large { width: 130px; height: 100px; }

.defect-photo { width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--radius-card); background: var(--black); }


.toggle-row {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  font-size: var(--text-nav); font-weight: 400; color: var(--text-body);
  background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 14px 16px;
}
.toggle-row input { margin-top: 2px; }

/* ─── Live scan ──────────────────────────────────────────────────────────── */
.scan-view { display: flex; flex-direction: column; gap: var(--gap-1); }
.scan-stage { position: relative; border-radius: var(--radius-card); overflow: hidden; background: var(--black); }
#scan-video { width: 100%; max-height: 55vh; display: block; object-fit: cover; }
.scan-hud {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--banner-scrim);
  color: var(--white); font-size: var(--text-nav);
}
.scan-counter { background: var(--white); color: var(--blue-700); border-radius: var(--radius-badge); padding: 0 10px; font-weight: 600; font-size: var(--text-label-big); line-height: 22px; }
.scan-tip { font-size: var(--text-nav); }
.scan-findings { display: flex; flex-direction: column; gap: var(--gap-1); }
.finding-card {
  display: flex; gap: var(--gap-1); align-items: center;
  background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 10px;
  animation: fade-in var(--duration) var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }
.finding-card img { width: 72px; height: 56px; object-fit: cover; border-radius: var(--radius-badge); flex-shrink: 0; }
.finding-info { flex: 1; min-width: 0; }
.finding-info p { margin: 0; font-size: var(--text-nav); line-height: 1.4; }
.finding-info small { color: var(--text-muted); font-size: var(--text-label-big); }
.finding-actions { display: flex; flex-direction: column; gap: 4px; }
.finding-actions button { min-height: 40px; padding: 6px 12px; font-size: var(--text-label-big); }
.finding-card.match { box-shadow: var(--shadow-card), 0 0 0 2px var(--blue-100) inset; }
.finding-card.match .finding-info { width: 100%; }
.match-label { display: block; font-weight: 600; color: var(--blue-700); }
.finding-card.match p { margin-top: 6px; }
.match-diff { display: flex; gap: 6px; align-items: flex-start; font-size: var(--text-label-big); }
.match-actions { margin-top: 10px; flex-wrap: wrap; }
.match-actions button { flex: 1 1 auto; min-height: 44px; padding: 8px 12px; }
.finding-card.saved { box-shadow: var(--shadow-card), 0 0 1px var(--green-600) inset; }
.saved-mark { color: var(--state-success); display: inline-flex; padding: 0 8px; }


/* ─── Spraakmemo ─────────────────────────────────────────────────────────── */
.memo-live {
  display: flex; align-items: center; gap: 10px; margin-top: var(--flow-tight);
  padding: 10px 14px; background: var(--grey-100); border-left: 4px solid var(--red-600);
  border-radius: var(--radius-label); font-size: var(--text-nav); min-height: 44px;
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red-600); flex-shrink: 0; animation: rec-pulse 1.1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: 0.25; } }
.memo-interim { color: var(--text-muted); font-style: italic; min-width: 0; }
button.recording { background: var(--state-error); color: var(--white); }
#memo-audio { width: 100%; margin-top: var(--flow-tight); }

/* ─── Rapport & calculatie (document) ────────────────────────────────────── */
.report { background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--card-padding); margin-top: var(--gap-2); }
.letterhead { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--gap-2); padding-bottom: var(--gap-2); border-bottom: 2px solid var(--border-strong); }
.letterhead img { height: 44px; width: auto; }
.letterhead address { font-style: normal; font-size: 13px; line-height: 1.5; text-align: right; color: var(--ink-600); }
.letterhead address b { color: var(--blue-700); font-weight: 700; }
@media (max-width: 480px) { .letterhead address { display: none; } }
.report-title { margin-top: var(--gap-2); font-size: var(--h2-sm); }
.report-meta { width: 100%; border-collapse: collapse; margin-top: var(--flow-tight); font-size: var(--text-nav); }
.report-meta td { padding: 6px 0; border-bottom: 1px solid var(--border-default); vertical-align: top; }
.report-meta td:first-child { color: var(--text-muted); width: 38%; padding-right: 10px; }
.report-room { margin-top: var(--flow-block-sm); }
.report-room h3 { font-size: 20px; padding-bottom: 6px; border-bottom: 2px solid var(--border-strong); color: var(--blue-700); }
.report-defect { display: flex; gap: var(--gap-1); margin-top: var(--flow-tight); break-inside: avoid; page-break-inside: avoid; }
.report-defect img { width: 130px; height: 100px; object-fit: cover; border-radius: var(--radius-badge); flex-shrink: 0; }
.report-defect .rd-info { font-size: var(--text-nav); line-height: 1.45; min-width: 0; }
.report-defect .rd-info p { margin: 2px 0; }
.sev { display: inline-block; font-size: var(--text-label); font-weight: 500; line-height: 18px; padding: 0 8px; border-radius: var(--radius-label); background: var(--grey-250); color: var(--black); }
.sev-hoog { background: var(--state-error); color: var(--white); }
.sev-middel { background: var(--state-warning); color: var(--black); }
.report-footer { font-size: var(--text-label-big); color: var(--text-muted); margin-top: var(--flow-block-sm); line-height: 1.5; }

.signatures { display: flex; gap: var(--gap-2); margin-top: var(--flow-block); flex-wrap: wrap; }
.sig-block { flex: 1; min-width: 220px; }
.sig-block p { font-size: var(--text-nav); color: var(--text-label); font-weight: 600; }
.sig-pad { display: block; width: 100%; height: 140px; margin-top: 4px; border: 1px dashed var(--border-default); background: var(--white); touch-action: none; }
.sig-clear { background: none; border: 0; color: var(--blue-700); font-size: var(--text-label-big); font-weight: 600; min-height: 36px; padding: 0; }
.sig-clear:hover { background: none; color: var(--blue-600); }

.calc-group-title { margin-top: var(--flow-block-sm); font-size: 20px; color: var(--blue-700); padding-bottom: 6px; border-bottom: 2px solid var(--border-strong); }
.calc-room-title { margin: var(--flow-tight) 0 0; font-size: var(--text-label); font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: var(--tracking-upper); }
.calc-line { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-default); break-inside: avoid; page-break-inside: avoid; }
.calc-line .cl-main { flex: 1; min-width: 0; }
.calc-line .cl-main p { margin: 0; font-size: var(--text-nav); line-height: 1.4; }
.calc-line .cl-main small { color: var(--text-muted); font-size: var(--text-label-big); }
.cl-qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cl-qty input { width: 4.2rem; height: 40px; padding: 0 8px; text-align: right; font-size: var(--text-nav); }
.cl-qty small { color: var(--text-muted); min-width: 1.6rem; font-size: var(--text-label); }
.cl-total { min-width: 4.8rem; text-align: right; font-size: var(--text-nav); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cl-actions { display: flex; flex-direction: column; gap: 2px; }
.cl-actions button { min-height: 32px; padding: 2px 8px; font-size: var(--text-label); background: var(--grey-250); color: var(--black); }
.cl-actions .cl-del { background: none; width: auto; min-height: 32px; }
.calc-totals { width: 100%; border-collapse: collapse; margin-top: var(--flow-block-sm); font-size: var(--text-nav); }
.calc-totals td { padding: 6px 0; }
.calc-totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.calc-totals tr.grand td { border-top: 2px solid var(--blue-700); font-weight: 700; }
#calc-search-results li { cursor: pointer; }
#calc-search-results small { font-size: var(--text-label-big); }

/* ─── Login ──────────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-brand);
  padding: var(--gap-2); padding-top: calc(var(--gap-2) + env(safe-area-inset-top));
}
.login-illu { position: absolute; right: -20px; bottom: -10px; height: min(46vh, 380px); width: auto; pointer-events: none; }
.login-wrap { position: relative; width: 100%; max-width: 420px; }
.login-card { background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-float); padding: var(--gap-3) var(--card-padding); }
.login-logo { display: block; height: 56px; width: auto; }
.login-card h1 { margin-top: var(--gap-2); font-size: var(--h2-sm); }
.login-card .lead { margin-top: 4px; font-size: var(--text-nav); color: var(--ink-600); }
.login-card .login-msg { margin-top: var(--gap-2); }
.login-card .small { margin-top: var(--gap-2); font-size: var(--text-label-big); color: var(--text-muted); line-height: 1.5; }
.ms-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 56px; margin-top: var(--gap-2); padding: 12px 16px;
  background: var(--white); color: #1f1f1f; font-weight: 600; font-size: var(--text-button-lg);
  border: 1px solid #8c8c8c; border-radius: var(--radius-button); text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease);
}
.ms-btn:hover { background: #f3f3f3; color: #1f1f1f; }
.ms-btn:active { background: #e6e6e6; }
.ms-btn + .ms-btn { margin-top: 12px; }

/* Login-route binnen de app: blauw vlak, kop verborgen. */
body.login-mode { background: var(--surface-brand); }
body.login-mode .topbar, body.login-mode .page-title, body.login-mode .page-sub { display: none; }
body.login-mode #app { max-width: none; padding: 0; }
#view-login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: var(--gap-2); padding-top: calc(var(--gap-2) + env(safe-area-inset-top)); position: relative; overflow: hidden; }
#view-login .login-wrap { position: relative; }

/* ─── Print ──────────────────────────────────────────────────────────────── */
@media print {
  @page { margin: 15mm; }
  .no-print, .topbar, .page-title { display: none !important; }
  body { background: var(--white); font-size: 12pt; }
  #app { max-width: none; padding: 0; }
  .report { box-shadow: none; padding: 0; margin: 0; border-radius: 0; }
  .letterhead address { display: block; }
  .report-title { font-size: 20pt; }
  .cl-qty input { border: 0; padding: 0; width: 3.2em; height: auto; font-size: 11pt; }
  .sig-clear { display: none; }
}

/* ─── Kantoorweergave (desktop) ──────────────────────────────────────────── */
.only-desktop { display: none; }
@media (min-width: 1024px) { .only-desktop { display: inline-flex; } }
body.office { background: var(--surface-page); }
.office .container { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.office-header { position: sticky; top: 0; z-index: 20; height: 95px; background: var(--white); box-shadow: var(--shadow-bar); }
.office-header .container { height: 100%; display: flex; align-items: center; gap: 40px; }
.office-logo img { height: 58px; width: auto; display: block; }
.office-nav { display: flex; gap: 30px; font-size: var(--text-nav); }
.office-nav a { color: var(--black); text-decoration: none; }
.office-nav a:hover, .office-nav a.active { color: var(--blue-700); }
.office-link { display: inline-flex; align-items: center; gap: 8px; color: var(--blue-700); text-decoration: none; font-size: var(--text-nav); white-space: nowrap; }
.office-main { padding-top: 40px; padding-bottom: 80px; }
.office-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.office-title h1 { font-size: 43px; }
.office-title + .muted { margin-top: 10px; max-width: 70ch; }
.office-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.office-actions button, .office-title button { min-height: 48px; padding: 10px 20px; font-size: var(--text-button); }
.breadcrumbs { font-size: var(--text-label-big); margin-bottom: 20px; }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.table-wrap { overflow-x: auto; margin-top: 20px; background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.office-table { width: 100%; border-collapse: collapse; font-size: var(--text-nav); }
.office-table th, .office-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-default); vertical-align: top; }
.office-table th { font-weight: 600; color: var(--text-label); background: var(--grey-100); white-space: nowrap; }
.office-table th.num, .office-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.office-table tbody tr { cursor: pointer; transition: background-color var(--duration-fast) var(--ease); }
.office-table tbody tr:hover { background: var(--grey-050); }
.office-table a { text-decoration: none; font-weight: 600; }
.office-table tfoot td { font-weight: 700; border-top: 2px solid var(--blue-700); border-bottom: 0; }
.calc-table tbody tr { cursor: default; }
.office-report { margin-top: 20px; padding: 40px; }
.office-report .letterhead img { height: 58px; }
.office-meta { max-width: 640px; }
.office-h2 { margin-top: 40px; font-size: 27px; }
.office-room { margin-top: 20px; }
.office-room h3 { font-size: 22px; color: var(--blue-700); padding-bottom: 8px; border-bottom: 2px solid var(--border-strong); }
.office-defect { display: grid; grid-template-columns: 320px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--border-default); break-inside: avoid; }
.office-defect:last-child { border-bottom: 0; }
.office-photo { display: block; width: 320px; aspect-ratio: 4 / 3; border-radius: var(--radius-card); overflow: hidden; background: var(--grey-100); }
.office-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--duration-fast) var(--ease); }
a.office-photo:hover img { opacity: var(--hover-opacity); }
.office-photo.thumb-mic { display: flex; }
.office-defect-text p { margin: 0; font-size: 18px; line-height: 1.5; }
.office-defect-text p + p { margin-top: 4px; }
.office-defect-title { font-size: 20px; }
.office-defect-text .small { font-size: var(--text-label-big); margin-top: 8px; }
.office-table td.actions { width: 1%; padding-top: 6px; padding-bottom: 6px; }
.row-del { width: 36px; height: 36px; min-height: 0; padding: 0; background: none; color: var(--grey-500); }
.row-del:hover { background: none; color: var(--state-error); }
.danger-outline { color: var(--state-error); border-color: var(--state-error); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.copy-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-height: 0; padding: 0; margin-left: 4px; vertical-align: middle; background: none; border: 0; box-shadow: none; color: var(--grey-500); opacity: 0.8; border-radius: var(--radius-button); }
.copy-btn .ic { width: 15px; height: 15px; }
.copy-btn:hover { opacity: 1; background: none; color: var(--ink-800); }
.copy-btn.copied { opacity: 1; color: var(--state-success); }
.office-photo-wrap { position: relative; width: 320px; }
.copy-btn.on-photo { position: absolute; top: 6px; right: 6px; margin: 0; width: 28px; height: 28px; background: none; color: var(--white); opacity: 0.9; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.7)); }
.copy-btn.on-photo .ic { width: 18px; height: 18px; }
.copy-btn.on-photo:hover { opacity: 1; background: none; }
.copy-btn.on-photo.copied { color: var(--green-500); }
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 60; transform: translate(-50%, 12px); opacity: 0; max-width: min(90vw, 560px); padding: 12px 20px; background: var(--ink-800); color: var(--white); font-size: var(--text-nav); line-height: 1.4; border-radius: var(--radius-label); box-shadow: var(--shadow-float); pointer-events: none; transition: opacity var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Bevestigingsvenster (uitloggen) — kaartstijl, gecentreerd, donkere achtergrond. */
.confirm-dialog {
  width: min(420px, calc(100vw - 32px)); padding: var(--gap-3) var(--card-padding);
  border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-float);
  background: var(--white); color: var(--text-body);
}
.confirm-dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.confirm-dialog h2 { margin: 0; font-size: var(--h2-sm); }
.confirm-dialog p { margin-top: var(--gap-1); line-height: 1.5; }
.confirm-dialog .row { margin-top: var(--gap-2); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / 0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--radius-card); cursor: default; }
.lightbox p { color: var(--white); margin-top: 16px; font-size: var(--text-nav); text-align: center; }
.lightbox-close { position: absolute; top: 20px; right: 20px; width: 56px; height: 56px; padding: 0; background: none; color: var(--white); }
@media print {
  .office-header, .breadcrumbs, .office-title, .lightbox, .copy-btn { display: none !important; }
  .office-main { padding: 0; }
  .office-report { padding: 0; box-shadow: none; }
  .office-defect { grid-template-columns: 200px 1fr; }
  .office-photo { width: 200px; }
  .table-wrap { box-shadow: none; }
}
