/* ============================================================
   SMET.DAT — web UI design system
   1:1 reproductie van de WPF-app (App.xaml + MainWindow.xaml).
   Alle kleuren komen rechtstreeks uit de XAML-bronnen.
   ============================================================ */
:root {
    /* ── Smet brand (App.xaml) ── */
    --accent:        #FE3000;   /* AccentColor  */
    --accent-hover:  #DD2A00;   /* button hover */
    --accent-light:  #FFEAE6;   /* AccentColorLight */
    --tint:          #FFF8F6;   /* BackgroundTint */

    /* ── Neutralen (slate-schaal, zoals in de views) ── */
    --content-bg: #F9FAFB;      /* witte content-zone in MainWindow */
    --panel:      #FFFFFF;
    --ink:        #0F172A;      /* slate-900 — titels */
    --ink-700:    #334155;
    --ink-600:    #475569;
    --muted:      #64748B;      /* slate-500 — subtitels */
    --faint:      #94A3B8;      /* slate-400 — kleine labels */
    --line-300:   #CBD5E1;
    --line:       #E2E8F0;      /* slate-200 — scheiders */
    --border:     #E5E7EB;      /* kaartrand (MainWindow) */
    --chip:       #F1F5F9;      /* slate-100 — segmenten/chips */
    --surface:    #F8FAFC;      /* slate-50 — metric-panelen */

    /* ── Statuskleuren (jobsite-kaarten) ── */
    --ok-bg:   #DCFCE7;  --ok:   #16A34A;   /* geanalyseerd  */
    --warn-bg: #FEF3C7;  --warn: #D97706;   /* verouderd     */
    --info-bg: #DBEAFE;  --info: #2563EB;   /* bezig/analyse */
    --info-light: #EFF6FF;
    --bad-bg:  #FEE2E2;  --bad:  #DC2626;   /* verwijderen   */
    --indigo-bg: #EEF2FF; --indigo: #4F46E5; --indigo-line: #C7D2FE; /* groepen */

    --radius:  10px;
    --radius-sm: 5px;
    --shadow-sm: 0 1px 8px rgba(15,23,42,.06);
    --shadow-md: 0 4px 16px rgba(15,23,42,.14);
    --shadow-pop: 0 10px 28px rgba(15,23,42,.18);
    --sidebar-w: 216px;
    --app-zoom: 0.75;           /* standaard-paginazoom (75%), zie body{zoom} */
    /* Volledige viewport-hoogte gecompenseerd voor --app-zoom: 100vh telt niet mee
       in de zoom-schaling, dus shells die het scherm moeten vullen (.layout,
       .auth-wrap, vaste volhoge drawers) delen 100vh door de zoomfactor. */
    --app-screen-h: calc(100vh / var(--app-zoom));

    /* ── Materieel-familie: één canonieke schaal ──────────────────────────
       De Materieel-sectie draait op drie stylesheets (mt-* inventaris,
       mc-* boormachines, dt-* boorkoppen/frezen) die los van elkaar
       gegroeid zijn. Deze tokens zijn de gedeelde bron zodat dezelfde rol
       op elke tab hetzelfde getal krijgt. Waarden zijn PRE-ZOOM: body staat
       op zoom .75, dus 10px rendert als 7,5px — ga nooit onder --mt-fs-nano
       en gebruik geen halve pixels (die worden subpixels).                  */
    --mt-fs-h1:     22px;   /* schermtitel van een tab                       */
    --mt-fs-h2:     19px;   /* detailpaneel- en dialoogtitel                 */
    --mt-fs-h3:     15px;   /* kaart-, lade- en sectietitel                  */
    --mt-fs-body:   13px;   /* tekst, rij-identiteit, knop, veldwaarde       */
    --mt-fs-meta:   12px;   /* veldlabel, kleine knop, secundaire meta       */
    --mt-fs-micro:  11px;   /* tabelkop, chip, hint                          */
    --mt-fs-nano:   10px;   /* uppercase micro-label (ondergrens)            */

    --mt-fw-medium: 500;    /* lichte nadruk in een tabelcel                 */
    --mt-fw-semi:   600;    /* titels, knoppen, labels                       */
    --mt-fw-bold:   700;    /* maximale nadruk — vervangt alle 800-gewichten */

    --mt-radius-card:    10px;    /* kaart / paneel / tabelomhulsel          */
    --mt-radius-ctrl:     8px;    /* knop, invoer, select                    */
    --mt-radius-ctrl-sm:  7px;    /* kleine icoon-/mini-knop                 */
    --mt-radius-pill:    999px;   /* chip, badge, statuspil                  */

    --mt-shell-bg: #F8F9FC;                        /* achtergrond van de shell */
    --mt-card-shadow:       0 1px 2px rgba(15,23,42,.04);
    --mt-card-shadow-hover: 0 6px 20px rgba(15,23,42,.09);

    --mt-ctrl-pad:   9px 11px;   /* = de app-basis voor invoervelden          */
    --mt-btn-pad:    9px 16px;   /* md-knop                                   */
    --mt-btn-pad-sm: 6px 10px;   /* sm-knop                                   */

    --mt-focus-ring:    0 0 0 3px var(--accent-light);  /* invoervelden       */
    --mt-focus-outline: 2px solid var(--accent);        /* knoppen/links/tabs */

    /* Eén expliciete stapeling i.p.v. losse z-indexen per stylesheet. */
    --mt-z-pop:    30;   /* popover binnen de content (info-ballon)           */
    --mt-z-scrim:  40;   /* scrim onder een lade                              */
    --mt-z-drawer: 50;   /* slide-over lade                                   */
    --mt-z-modal:  60;   /* modale dialoog                                    */
    --mt-scrim-bg: rgba(15,23,42,.45);   /* één dekking voor lade én dialoog  */

    /* Bevroren tool-kolom van de planner-tijdlijn. Stond als hetzelfde magic
       number op twee plaatsen (.tp2-corner/.tp2-head én de width-calc van
       .tp2-canvas); wie er één aanpaste, schoof stil de tijdas scheef. */
    --mt-tp-toolcol: 210px;

    /* Accenttinten die al in gebruik waren zonder token (elk >=5x in de
       Materieel-familie). Waarden ongewijzigd — enkel een naam, zodat ze niet
       opnieuw als losse hex uiteengroeien. */
    --indigo-ink:  #4338CA;   /* tekst op --indigo-bg          */
    --indigo-400:  #6366F1;   /* lichter indigo-accent         */
    --indigo-100:  #E0E7FF;   /* indigo hover-vlak             */
    --amber-ink:   #92400E;   /* tekst op --amber-bg           */
    --amber-600:   #B45309;
    --amber-bg:    #FFFBEB;
    --amber-line:  #FDE68A;
    --red-ink:     #B91C1C;   /* tekst bij een rode melding    */
    --red-bg:      #FEF2F2;
    --red-line:    #FCA5A5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden-attribuut wint van component-display */
html, body { margin: 0; height: 100%; }
body {
    font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui,
        -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink); background: var(--content-bg); font-size: 13px; line-height: 1.45;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    /* Standaard-zoom van de webapp: alsof de browser op 75% staat. Eén bron van
       waarheid via --app-zoom; de viewport-hoge shells (.layout/.auth-wrap) delen
       hun 100vh door dezelfde factor zodat ze de volledige hoogte blijven vullen. */
    zoom: var(--app-zoom);
}
a { color: inherit; text-decoration: none; }
a[data-href] { cursor: pointer; }   /* URL-preview verborgen: link via JS, hand-cursor behouden */
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* Iconen — Fluent System Icons (fill-based), exact als de WPF-app. Kleur via currentColor. */
.sidebar svg, .content svg, .auth-card svg { fill: currentColor; stroke: none; }
svg.ic { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }

/* ============================================================
   LAYOUT  (Grid: sidebar | content) — MainWindow.xaml
   ============================================================ */
/* App-shell vast op de viewport: de sidebar blijft staan, scrollen gebeurt
   binnen een paneel (de .content-zone of een interne scrollcontainer van een
   scherm) i.p.v. dat het hele document — inclusief de linkse kader — meescrolt. */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--app-screen-h); height: var(--app-screen-h); overflow: hidden; }

/* ── SIDEBAR ── (blijft vast; scrollt alleen intern bij een héél lage viewport) */
.sidebar { display: flex; flex-direction: column; background: var(--accent); min-width: 0; min-height: 0; overflow-y: auto; }

/* witte logo-zone (border-bottom #E5E7EB, padding 22 32 22 18) */
.sidebar-logo {
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 32px 12px 18px;
}
.sidebar-logo img { height: 90px; max-width: 100%; display: block; margin: 0 auto; }
.badge-toolbox {
    display: inline-block; margin-top: 10px; background: var(--accent);
    color: #fff; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
}

/* rode nav-zone */
.sidebar-nav { flex: 1; display: flex; flex-direction: column; padding: 0; }
.nav-label {
    color: rgba(255,255,255,.5); font-size: 10px; font-weight: 600;
    letter-spacing: .04em; margin: 22px 0 10px 22px;
}
.nav-list { display: flex; flex-direction: column; padding: 0 12px; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 13px; height: 46px; padding: 0 16px;
    border-radius: 8px; color: #fff; cursor: pointer;
}
.nav-item .nav-ico { width: 18px; height: 18px; opacity: .7; flex: none; }
.nav-item .nav-text { font-size: 13px; opacity: .75; }
.nav-item:hover { background: rgba(255,255,255,.2); }
.nav-item.active { background: #fff; }
.nav-item.active .nav-ico { opacity: 1; color: var(--accent); }
.nav-item.active .nav-text { opacity: 1; color: var(--accent); font-weight: 600; }
/* Telbadge (lokale-map-sync): aantal werven met nieuwe ASCII-bestanden. */
.nav-item .nav-badge {
    margin-left: auto; flex: none; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #F59E0B; color: #fff; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.nav-item.active .nav-badge { background: var(--accent); }

.nav-spacer { flex: 1; }

/* Instellingen + footer onderaan */
.nav-settings { padding: 4px 12px 8px; }
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.15); padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sidebar-footer .copy { color: rgba(255,255,255,.45); font-size: 11px; }
.sidebar-user { min-width: 0; display: block; text-decoration: none;
    border-radius: 7px; padding: 4px 8px; margin: -4px -8px; transition: background .12s ease; }
a.sidebar-user:hover { background: rgba(255,255,255,.12); }
.sidebar-user .u-name { color: #fff; font-weight: 600; font-size: 12px; line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .u-role { color: rgba(255,255,255,.6); font-size: 10.5px; text-transform: capitalize; }
.btn-logout {
    background: rgba(255,255,255,.15); color: #fff; border: none; cursor: pointer;
    width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none;
}
.btn-logout:hover { background: rgba(255,255,255,.3); }
.btn-logout svg { width: 16px; height: 16px; }

/* ── CONTENT ── (witte zone met #F9FAFB, padding 28 20 28 28)
   De eigen verticale scrollcontainer van de app: enkel deze zone scrollt,
   de sidebar blijft vast. Schermen met een eigen 100%/100vh-layout
   (processen, planning, attachments, instellingen) vullen exact deze hoogte
   en beheren hun interne scroll zelf. */
.content { background: var(--content-bg); min-width: 0; min-height: 0; padding: 20px 28px 28px; overflow-x: hidden; overflow-y: auto; }

/* ============================================================
   APP-WIDE ANALYSE-VOORTGANGSBALK  (#smet-progress)
   .EXE-stijl: één dunne, horizontale balk over de VOLLEDIGE contentbreedte,
   onderaan vastgepind — Smet-oranje fill (i.p.v. het oude per-kaart blauw),
   met statustekst links + percentage rechts. sync.js vult 'm (singleton op
   <body>; left = sidebarbreedte zodat hij exact de contentkolom vult).
   ============================================================ */
#smet-progress {
    position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 9998;
    background: var(--panel); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(15,23,42,.08);
    padding: 9px 28px 11px;
    transform: translateY(100%); opacity: 0; pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
}
#smet-progress.show { transform: translateY(0); opacity: 1; }
#smet-progress .gp-row { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-size: 12px; line-height: 1.3; }
#smet-progress .gp-spin { width: 14px; height: 14px; flex: none; fill: var(--accent); animation: gp-rotate 1s linear infinite; }
#smet-progress .gp-label { flex: 1 1 auto; min-width: 0; color: var(--ink-700); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#smet-progress .gp-pct { flex: none; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
/* Stop-knop: annuleert de lopende analyse (eigen job). Verborgen tot er een annuleerbare job is.
   LET OP pointer-events: #smet-progress zelf staat op pointer-events:none (zodat de balk klikken op
   de content eronder niet blokkeert). pointer-events ERFT, dus de knop moet 'm expliciet terug op
   auto zetten — anders is de knop wel zichtbaar maar volledig onklikbaar (klikken gaan er dwars
   doorheen). Dit was de bug waardoor de Stop-knop nooit reageerde. */
#smet-progress .gp-stop {
    flex: none; display: inline-flex; align-items: center; gap: 5px; margin-left: 4px;
    padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--panel); color: var(--ink-700); font: inherit; font-size: 11px; font-weight: 700;
    cursor: pointer; pointer-events: auto; line-height: 1; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
#smet-progress .gp-stop svg { width: 12px; height: 12px; fill: currentColor; }
#smet-progress .gp-stop:hover { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }
#smet-progress .gp-stop[hidden] { display: none; }
#smet-progress .gp-track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
/* width is written directly by sync.js (no rAF — that froze in background tabs); this transition
   gives the glide. CSS transitions keep their end-state in a hidden tab, so the bar stays truthful. */
#smet-progress .gp-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .35s linear; }
@keyframes gp-rotate { to { transform: rotate(360deg); } }

/* ============================================================
   SCHERM-HEADER (titel + subtitel, in elk blad)
   ============================================================ */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.page-head h1 { font-size: 26px; font-weight: 600; color: var(--ink); }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .meta { color: var(--faint); font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   COMPONENTEN
   ============================================================ */
/* Kaart */
.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 16px;
}
.card-hover:hover { border-color: var(--line-300); }
.card-pad-lg { padding: 20px; }
.card h2 { font-size: 15px; margin-bottom: 12px; }

/* Metric-paneel (M³ / OPERATIES / M DIEP) */
.metrics {
    display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr; align-items: center;
    background: var(--surface); border: 1px solid #EEF1F4; border-radius: 4px; padding: 13px 8px;
}
.metrics .sep { background: var(--line); align-self: stretch; margin: 2px 0; }
.metric { text-align: center; }
.metric .val { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric .lbl { font-size: 9px; font-weight: 600; color: var(--faint); margin-top: 3px; letter-spacing: .02em; }

/* Status-strip (klikbare teller-tabs) */
.statusstrip { display: inline-flex; gap: 0; background: var(--chip); border-radius: 10px; padding: 3px; height: 42px; align-items: center; }
.statustab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.statustab .t-lbl { color: var(--muted); font-weight: 500; }
.statustab .t-cnt { font-weight: 700; }
.statustab:hover { background: #E5EAF0; }
.statustab.active { background: #fff; }
.statustab.active .t-lbl { color: var(--ink); font-weight: 600; }

/* Filterbalk (dropdowns) */
.filterbar {
    display: inline-flex; align-items: center; height: 42px; gap: 0; padding: 0 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.filterbar .fb-ico { width: 15px; height: 15px; color: var(--faint); }
.filterbar input[type=text], .filterbar select {
    border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--ink-700);
    padding: 0 0 0 9px; outline: none;
}
.filterbar select { cursor: pointer; font-weight: 500; padding-right: 20px; width: auto; }
.filterbar .fb-div { width: 1px; align-self: stretch; background: #EAEFF4; margin: 7px 10px; }
/* Zoekveld (naam/contract) — leunt op de filterbalk-styling, blijft één geheel. */
.filterbar .fb-search { width: 190px; }
.filterbar .fb-search::placeholder { color: var(--faint); }
.filterbar .fb-clear { display: inline-grid; place-items: center; margin-left: 4px; color: var(--faint);
    border-radius: 4px; width: 20px; height: 20px; flex: none; cursor: pointer; }
.filterbar .fb-clear:hover { background: var(--chip); color: var(--ink-700); }
.filterbar .fb-clear svg { width: 12px; height: 12px; }

/* Pills / knoppen */
.btn {
    display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px;
    border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-700);
    font-size: 12.5px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--line); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 2px 12px rgba(254,48,0,.30); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { height: auto; padding: 7px 14px; border-radius: 4px; font-size: 12px; box-shadow: none; }
.btn-cta { background: var(--accent); color: #fff; border: 0; }
.btn-cta:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--chip); color: var(--ink-700); border: 0; }
.btn-secondary:hover { background: var(--line); }
/* quiet icon button (delete e.d.) */
.icon-btn { background: transparent; border: 0; cursor: pointer; padding: 6px; border-radius: 4px; color: var(--faint); display: inline-grid; place-items: center; }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.icon-btn:hover { background: var(--chip); }

/* Toolbar (wrap) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .count { color: var(--faint); font-size: 12px; }
.toolbar .count b { color: var(--ink-700); font-weight: 600; }
.spacer { flex: 1; }

/* Kaart-grid (3 koloms zoals UniformGrid Columns=3) */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1200px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px)  { .card-grid { grid-template-columns: 1fr; } }
.section-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 8px 2px; }

/* status-tegel (gekleurd vierkant icoon) */
.tile { width: 30px; height: 30px; border-radius: 4px; display: grid; place-items: center; flex: none; background: var(--chip); color: var(--faint); }
.tile svg { width: 15px; height: 15px; }
.tile.ok   { background: var(--ok-bg);   color: var(--ok); }
.tile.warn { background: var(--warn-bg); color: var(--warn); }
.tile.info { background: var(--info-bg); color: var(--info); }
.tile.indigo { background: var(--indigo-bg); color: var(--indigo); }

/* statuswoord */
.status-word { font-size: 11px; font-weight: 600; }
.status-word.ok   { color: var(--ok); }
.status-word.warn { color: var(--warn); }
.status-word.info { color: var(--info); }
.status-word.none { color: var(--faint); }
.status-word.pending { color: var(--muted); }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--chip);
    color: var(--ink-700); font-size: 11px; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }

/* "Niet meer tonen" onder een FEATURE IN BETA-badge (Nieuwe werf + Analyse).
   Zet de persoonlijke ShowBeta-voorkeur uit; heraan te zetten via Instellingen → Gebruiker. */
.beta-dismiss { margin-top: 4px; }
.beta-dismiss-btn {
    background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
    font-size: 11px; color: var(--muted); text-decoration: underline;
}
.beta-dismiss-btn:hover { color: var(--ink-700); }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Key/value */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }

/* Detail-grid */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .detail-grid { grid-template-columns: 1fr; } }

/* Forms */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; outline: none; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--mt-focus-ring); }
/* Chrome's UA-stylesheet zet op <button> een eigen font-family die NIET erft.
   Daardoor stond in elk dialoog "Opslaan" (<button>) in een ander lettertype
   dan "Annuleren" (<a>) ernaast. input/select/textarea hierboven erven al via
   `font: inherit`; knoppen deden dat als enige control niet. */
button, input[type=button], input[type=submit], input[type=reset] {
    font-family: inherit; font-size: inherit; line-height: 1.2;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }

/* Muted helper */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
code { background: var(--chip); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* Paginatie */
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; padding: 14px 8px; }

/* Berichten */
.messages { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.message { padding: 10px 14px; border-radius: 8px; font-size: 12.5px; }
.message-error   { background: var(--bad-bg);  color: #b91c1c; }
.message-success { background: var(--ok-bg);   color: #15803d; }
.message-info    { background: var(--info-light); color: #1d4ed8; }
.message-warning { background: var(--warn-bg); color: #b45309; }

/* Empty-state */
.empty { text-align: center; color: var(--faint); padding: 40px 16px; }

/* ============================================================
   DASHBOARD  (DashboardView.xaml)
   ============================================================ */
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; gap: 16px; }
.dash-head h1 { font-size: 28px; font-weight: 700; color: var(--ink); }
.dash-head .actions { display: flex; gap: 10px; }
.hbtn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-700);
    font-size: 13px; font-weight: 500; cursor: pointer; }
.hbtn:hover { background: var(--surface); border-color: var(--line-300); }
.hbtn svg { width: 15px; height: 15px; }

.kicker { font-size: 10px; font-weight: 700; color: var(--line-300); letter-spacing: .06em; margin: 0 0 14px; }
.kicker.mt { margin-top: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 6px; }
@media (max-width: 1180px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card { display: flex; flex-direction: column; min-height: 152px; background: #fff;
    border: 1px solid var(--line); border-radius: 14px; padding: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06); cursor: pointer; }
.kpi-card:hover { background: #F5F9FF; border-color: #93C5FD; }
.kpi-card:active { background: var(--info-light); }
.kpi-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.kpi-tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none;
    background: var(--tile-bg); color: var(--tile-fg); }
.kpi-tile svg { width: 18px; height: 18px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1; margin-top: auto;
    font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi-value .unit { font-size: 17px; color: var(--faint); font-weight: 700; letter-spacing: 0; }
.kpi-link { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; margin-top: 14px; color: var(--link); }
.kpi-link svg { width: 12px; height: 12px; }

/* Duo-tegel: twee cijfers (boorkoppen + frezen) in één kaart met dezelfde vorm en
   afmetingen als de andere KPI-kaarten. Elke helft is een eigen link, dus de kaart
   zelf is géén klikdoel — vandaar cursor:default op de kaart en pointer op de helft. */
.kpi-card-duo { cursor: default; }
.kpi-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; }
.kpi-duo-part { display: flex; flex-direction: column; min-width: 0; cursor: pointer; }
.kpi-duo-part + .kpi-duo-part { border-left: 1px solid var(--line); padding-left: 14px; }
/* .kpi-value duwt zichzelf normaal naar de onderkant van de kaart; binnen een helft
   doet .kpi-duo dat al, anders schuiven de twee cijfers uit elkaar. */
.kpi-duo-part .kpi-value { margin-top: 0; }
/* nowrap: een tweede regel zou de kaart hoger maken dan de rest van de rij (grid
   rekt álle kaarten mee), en dan klopt "zelfde afmetingen" niet meer. */
.kpi-duo-part .kpi-link { font-size: 11px; white-space: nowrap; }
.kpi-duo-part:hover .kpi-link { text-decoration: underline; }

.datacard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.recent { width: 100%; border-collapse: collapse; }
.recent th { text-align: left; font-size: 10px; font-weight: 600; color: var(--faint);
    text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 10px 0; border-bottom: 1px solid var(--chip); }
.recent td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--chip); font-size: 13px; color: var(--ink-600);
    font-variant-numeric: tabular-nums; }
.recent tbody tr:last-child td { border-bottom: 0; }
.recent tbody tr { cursor: pointer; }
.recent tbody tr:hover td { background: #F5F9FF; }
.recent .nm { display: flex; align-items: center; gap: 10px; color: #1E293B; font-weight: 500; }
.recent .nm::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: #BFDBFE; flex: none; }
.morelink { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; font-size: 12px; color: var(--info); }
.morelink:hover { text-decoration: underline; }
.morelink svg { width: 12px; height: 12px; }

/* ============================================================
   JOBSITES  (JobsiteView.xaml)
   ============================================================ */
/* status-strip teller-kleuren */
.statustab .t-cnt.c-all   { color: var(--ink); }
.statustab .t-cnt.c-ok    { color: var(--ok); }
.statustab .t-cnt.c-open  { color: var(--info); }
.statustab .t-cnt.c-warn  { color: var(--warn); }
.statustab .t-cnt.c-empty { color: var(--faint); }

/* merge-toggle "Werven samenvoegen" */
.merge-toggle { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
    color: var(--muted); font-size: 12px; cursor: pointer; }
.merge-toggle svg { width: 13px; height: 13px; }
.merge-toggle:hover { background: var(--line); }
.merge-toggle.active { background: var(--indigo-bg); border-color: var(--indigo-line); color: var(--indigo); font-weight: 600; }
.merge-toggle .caret { width: 11px; height: 11px; opacity: .65; }

/* dropdown eronder: werf-groep maken vs. werf samenvoegen */
.merge-wrap { position: relative; }
.merge-pop { position: absolute; right: 0; top: 48px; z-index: 30; width: 330px; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); }
.pop-opt { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px;
    background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
.pop-opt:hover { background: var(--indigo-bg); }
.pop-opt > svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--indigo); }
.pop-opt b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.pop-opt .po-txt > span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--faint); }

/* paneel "Werf samenvoegen" (nevenwerf → hoofdwerf) */
.merge-panel { background: var(--indigo-bg); border: 1px solid var(--indigo-line); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 14px; }
.merge-panel .mp-head { display: flex; align-items: flex-start; gap: 9px; }
.merge-panel .mp-head > svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--indigo); }
.merge-panel .mp-intro { flex: 1; min-width: 0; }
.merge-panel .mp-intro b { display: block; font-size: 12.5px; font-weight: 600; color: #4338CA; }
.merge-panel .mp-intro span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: var(--ink-600); }
.merge-panel .mp-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.merge-panel .mp-field { flex: 1 1 260px; min-width: 0; }
.merge-panel .mp-field > span { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.merge-panel select { width: 100%; height: 36px; padding: 0 8px; background: #fff;
    border: 1px solid var(--indigo-line); border-radius: 8px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.merge-panel select option:disabled { color: var(--faint); }
.merge-panel .mp-arrow { width: 15px; height: 15px; flex: none; margin-bottom: 11px; color: var(--indigo); }
.merge-panel .btn-cta { display: inline-flex; align-items: center; gap: 6px; height: 36px;
    padding: 0 16px; border-radius: 8px; font-weight: 600; }
.merge-panel .btn-cta[disabled] { opacity: .5; cursor: not-allowed; }
.merge-panel .mp-note { margin-top: 9px; font-size: 11.5px; color: #4338CA; }

/* kaarten aanklikken tijdens "Werf samenvoegen": 1e klik = hoofdwerf, 2e = nevenwerf.
   De kaartknoppen (favoriet/verwijderen) wijken: in deze modus is de hele kaart de keuze. */
body.sitemerge-mode #jobsite-cards .job-card { cursor: pointer; }
body.sitemerge-mode #jobsite-cards .job-card.dim { cursor: not-allowed; }
body.sitemerge-mode #jobsite-cards .job-fav,
body.sitemerge-mode #jobsite-cards .job-del { display: none; }
.job-card.pick-main, .job-card.pick-side { border-color: var(--indigo); background: var(--indigo-bg); }
.job-card.pick-main::after, .job-card.pick-side::after {
    position: absolute; top: 12px; right: 12px; z-index: 1; padding: 2px 8px;
    border-radius: 999px; background: var(--indigo); color: #fff;
    font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.job-card.pick-main::after { content: "1 · HOOFDWERF"; }
.job-card.pick-side::after { content: "2 · NEVENWERF"; background: var(--accent); }

/* BATCH ANALYSE pill + popup */
.batch-pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 15px;
    background: var(--accent); color: #fff; border: 0; border-radius: 10px; cursor: pointer;
    font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; box-shadow: var(--shadow-sm);
    transition: background .15s ease, box-shadow .15s ease; }
.batch-pill:hover { background: var(--accent-hover); box-shadow: 0 2px 12px rgba(254,48,0,.22); }
.batch-pill.open { background: var(--accent-hover); box-shadow: 0 2px 12px rgba(254,48,0,.22); }
.batch-pill .bp-ic { width: 15px; height: 15px; }
.batch-pill .bp-caret { width: 12px; height: 12px; margin-left: -1px; opacity: .75;
    transition: transform .18s ease; }
.batch-pill.open .bp-caret { transform: rotate(180deg); }
.batch-wrap { position: relative; }
.batch-pop { position: absolute; right: 0; top: 48px; z-index: 30; width: 304px; padding: 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); }
.batch-pop h4 { font-size: 15px; color: var(--ink); }
.batch-pop .hint { font-size: 11.5px; color: var(--faint); margin: 2px 0 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--chip); border-radius: 8px; padding: 3px; margin-top: 14px; }
.seg button { border: 0; background: transparent; border-radius: 6px; padding: 8px 0; font-size: 12.5px;
    color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; }
.batch-pop label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin: 14px 0 5px; }
.batch-pop select { min-height: 34px; }

/* Status-dropdown (vervangt statusstrip als toolbar omslaat) */
.status-drop {
    display: none; height: 42px; padding: 0 8px; background: var(--chip);
    border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
    font-size: 12.5px; font-weight: 600; color: var(--ink-700); cursor: pointer; width: auto;
}

/* werf-groep kaart — identieke opbouw als .job-card, blauw geaccentueerd.
   Erft alle .job-* stijlen; enkel de kleuraccenten verschillen. */
.job-card.is-group { border-color: var(--indigo-line); background: var(--indigo-bg); }
.job-card.is-group:hover { border-color: var(--indigo); }
.status-word.group { color: var(--indigo); }

/* merge-balk */
.merge-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--indigo-bg); border: 1px solid var(--indigo-line); border-radius: 10px;
    padding: 10px 14px; margin-bottom: 14px; }
.merge-bar .mb-txt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #4338CA; }
.merge-bar .mb-txt svg { width: 14px; height: 14px; color: var(--indigo); }
.merge-bar .mb-count { color: var(--indigo); white-space: nowrap; }
.merge-bar .btn-cta[disabled] { opacity: .5; cursor: not-allowed; }

/* samenvoeg-modus: selectievinkje op de kaart (enkel zichtbaar in merge-mode) */
.merge-check { display: none; align-items: center; margin-top: 2px; }
body.merge-mode .merge-check { display: flex; }
.merge-check input { width: 16px; height: 16px; accent-color: var(--indigo); cursor: pointer; }
body.merge-mode #jobsite-cards .job-card { cursor: pointer; }
body.merge-mode #jobsite-cards .job-card.dim { cursor: not-allowed; }

/* naam-popup "Nieuwe werf-groep" (CreateJobsiteGroupDialog) */
.group-pop { width: 360px; }
.group-pop input[type="text"] { width: 100%; min-height: 34px; padding: 0 10px; font-size: 12.5px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.group-pop input[type="text"]:focus { outline: 2px solid var(--indigo-line); border-color: var(--indigo); }

/* jobsite-kaart */
.section-title { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 8px 2px; }
.job-card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 16px; display: flex; flex-direction: column; min-height: 224px;
    overflow: hidden; container-type: inline-size; }
.job-card:hover { border-color: var(--line-300); }
.job-card.dim { opacity: .45; }
.job-card.selected { border-color: var(--indigo); background: var(--indigo-bg); }
.job-head { display: flex; align-items: flex-start; gap: 11px; }
.job-name { font-size: 14.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; }
.job-sub .dot { color: var(--line-300); }
.job-sub .contract { color: var(--faint); }
.job-mid { flex: 1; display: flex; align-items: center; margin: 12px 0; }
.job-mid .metrics { width: 100%; }
.empty-mid { text-align: center; width: 100%; color: var(--faint); }
.empty-mid svg { width: 22px; height: 22px; color: var(--line-300); }
.empty-mid div { font-size: 11px; margin-top: 7px; }
/* progress */
.prog { width: 100%; }
.prog-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 7px; }
.prog-top .lbl { color: var(--ink-600); }
.prog-top .pct { color: var(--info); font-weight: 600; }
.prog-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.prog-bar > i { display: block; height: 100%; background: var(--info); }
/* machine + proces rij */
.job-mp { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.job-machine { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-600); cursor: pointer; }
.job-machine svg { width: 12px; height: 12px; color: var(--faint); }
.job-machine:hover, .job-machine:hover svg { color: var(--accent); }
.proc-chip { font-size: 11px; font-weight: 600; color: var(--ink-600); background: var(--chip); border-radius: 4px; padding: 3px 9px; cursor: pointer; }
.proc-chip:hover { background: var(--line); }
.proc-chip.none { background: #FFF7ED; color: var(--warn); }
/* footer */
.job-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border-top: 1px solid var(--chip); margin-top: 12px; padding-top: 11px; }
.job-date { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--faint); }
.job-date svg { width: 12px; height: 12px; color: var(--line-300); }
.job-actions { display: flex; gap: 8px; }
.icon-del { background: transparent; border: 0; cursor: pointer; padding: 6px; border-radius: 4px; color: var(--faint); display: inline-grid; place-items: center; }
.icon-del svg { width: 14px; height: 14px; }
.icon-del:hover { background: var(--bad-bg); color: var(--bad); }
.icon-fav { background: transparent; border: 0; cursor: pointer; padding: 6px; border-radius: 4px; color: var(--line-300); display: inline-grid; place-items: center; }
.icon-fav svg { width: 15px; height: 15px; }
.icon-fav:hover { background: var(--warn-bg); color: var(--warn); }
.icon-fav.active { color: var(--warn); }
.icon-fav.active svg { fill: var(--warn); }

/* Kaart-inhoud verbergen als kaart te smal is (container query) */
@container (max-width: 330px) {
    .job-mp { display: none; }
}

/* paginatie (Jobsites) */
.pg { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 4px; }
.pg a, .pg span.pgbtn { display: inline-flex; align-items: center; gap: 4px; background: var(--chip);
    border: 1px solid var(--line); border-radius: 6px; padding: 6px 14px; font-size: 12px; color: var(--ink-700); }
.pg a:hover { background: var(--line); }
.pg .pgbtn.off { opacity: .4; pointer-events: none; }
.pg .pgnum { font-size: 13px; font-weight: 500; color: #374151; }
.pg svg { width: 12px; height: 12px; }

/* ============================================================
   AUTH (login) — Smet-merk
   ============================================================ */
.auth-wrap { min-height: var(--app-screen-h); display: grid; place-items: center; background: var(--tint); }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 36px 34px; width: 360px; box-shadow: var(--shadow-md); }
.auth-card .auth-logo { height: 60px; display: block; margin: 0 auto 10px; }
.auth-card .auth-logo--bug { height: 63px; }   /* bugmelding: logo 50% groter */
.auth-badge { display: block; text-align: center; margin: 0 auto 22px; }
.auth-badge span { background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.auth-card .btn-primary { width: 100%; justify-content: center; margin-top: 6px; }
.auth-sub { text-align: center; color: var(--muted); margin: 4px 0 22px; }
.auth-card form label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
.auth-card form label:first-of-type { margin-top: 0; }
.auth-alt { text-align: center; font-size: 12.5px; color: var(--muted); margin: 20px 0 0; }
.auth-alt a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-field-error { color: #b91c1c; font-size: 11.5px; margin: 4px 0 0; }
.auth-card .message { margin-bottom: 16px; }
.auth-field-hint { font-weight: 400; text-transform: none; color: var(--faint); }
/* "Stuur een nieuwe code" — een knop (want POST), maar oogt als een link. */
.auth-linkbtn { display: block; width: 100%; background: none; border: 0; padding: 0;
    text-align: center; font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.auth-linkbtn:hover { text-decoration: underline; }

/* Inlogschermen op een telefoon. De app zelf blijft geweerd (_device_gate.html),
   maar aanmelden, een inlogcode invullen, een uitnodiging openen of je
   wachtwoord herstellen moet wél op een gsm kunnen — anders geraak je niet in de
   mobiele beheerconsole op /admin/mobile/. Zelfde maat als de device-gate.

   --app-zoom en --app-screen-h worden samen herzet: `zoom` volgt de eerste, en
   .auth-wrap zou anders op 133vh blijven staan en de kaart uit beeld duwen. */
@media (max-width: 699px), (max-height: 499px) {
    body.is-anon { --app-zoom: 1; --app-screen-h: 100vh; }
    body.is-anon .auth-wrap { padding: 24px 16px; }
    body.is-anon .auth-card { width: 100%; max-width: 360px; padding: 26px 20px; }
    /* Onder 16px zoomt Safari op iOS in zodra een veld focus krijgt, en dan
       staat de helft van het formulier buiten beeld. */
    body.is-anon .auth-card input, body.is-anon .auth-card select { font-size: 16px; }
}

/* Bugmelding — schermafbeelding plakken/uploaden */
.bug-shot-drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 16px 12px;
    text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.bug-shot-drop:hover, .bug-shot-drop.is-drag { border-color: var(--accent); background: var(--accent-light); }
.bug-shot-drop:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.bug-shot-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.bug-shot-empty svg { width: 20px; height: 20px; fill: var(--faint); }
.bug-shot-empty p { font-size: 11.5px; line-height: 1.5; margin: 0; }
.bug-shot-empty kbd { background: var(--chip); border: 1px solid var(--line); border-radius: 4px;
    padding: 1px 5px; font-size: 10.5px; font-family: inherit; }
.bug-shot-preview { position: relative; display: inline-block; max-width: 100%; }
.bug-shot-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; display: block; border: 1px solid var(--line); }
.bug-shot-remove { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); display: grid; place-items: center;
    cursor: pointer; color: var(--muted); padding: 0; }
.bug-shot-remove:hover { color: #b91c1c; border-color: #b91c1c; }
.bug-shot-remove svg { width: 12px; height: 12px; fill: currentColor; }
