/* Maes Industries — Private Portal (mijn.) · shell & components
   Reuses the public house style: white header, red accent rule, navy headings
   (Source Sans Pro), azure + red accents, soft cards. */

* { box-sizing: border-box; }
html, body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: var(--font); font-size: var(--fs-base); line-height: 1.6;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header -------------------------------------------------------------- */
.hdr { background: #fff; }
.hdr-in { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 15px 22px; }
.brandmark { display: inline-flex; } .brandmark img { height: 30px; display: block; }
.hdr .spacer { flex: 1; }
.hdr-right { display: flex; align-items: center; gap: 14px; }
.hdr-meta { text-align: right; line-height: 1.3; white-space: nowrap; }
.hdr-meta .label { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.hdr-meta .ver { font-size: 11px; color: var(--muted); opacity: .75; }

.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: #fff; }
.lang-btn { appearance: none; border: 0; background: transparent; cursor: pointer; font-family: var(--font); font-size: 12px; font-weight: 700; color: var(--muted); padding: 5px 11px; line-height: 1; }
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { background: var(--brand); color: #fff; }

.hdr-user { display: flex; align-items: center; gap: 12px; }
.hdr-user[hidden] { display: none; }
.hdr-user .who { text-align: right; line-height: 1.2; }
.hdr-user .name { display: block; font-weight: 700; color: var(--ink-strong); font-size: 13.5px; }
.hdr-user .acct { display: block; font-size: 12px; color: var(--muted); }

.accent-rule { height: 3px; background: var(--red); }

/* ---- Buttons ------------------------------------------------------------- */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: #fff; font-weight: 700; font-size: 15px;
    padding: 12px 22px; border-radius: 10px; border: 1px solid var(--brand);
}
.btn-primary:hover { background: var(--brand-600); text-decoration: none; }
.btn-primary[hidden] { display: none; }
.btn-ghost {
    display: inline-flex; align-items: center; font-weight: 600; font-size: 13px;
    color: var(--brand); padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 8px;
    white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--brand); text-decoration: none; }
.btn-ghost.is-busy { gap: 7px; color: var(--muted); cursor: progress; }
.btn-ghost.is-busy:hover { border-color: var(--line-strong); }
.btn-ghost.is-busy .mini-spin { width: 12px; height: 12px; }
.xlsx-wait { display: flex; align-items: center; gap: 9px; margin: -4px 0 14px; padding: 10px 14px; border-radius: 10px;
    background: var(--brand-tint); color: var(--ink-strong); font-size: 13.5px; font-weight: 600; }

/* ---- Page container ------------------------------------------------------ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 22px 10px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--azure-ink); display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.eyebrow::before { content: ""; width: 16px; height: 2px; background: var(--red); border-radius: 2px; }
.state { text-align: center; color: var(--muted); padding: 56px 16px; }
.state .big { font-size: 18px; font-weight: 700; color: var(--ink-strong); }

/* Loading spinner */
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: maes-spin .7s linear infinite; }
.mini-spin { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: maes-spin .7s linear infinite; }
.panel-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 52px 16px; color: var(--muted); font-size: 14px; font-weight: 600; }
@keyframes maes-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .mini-spin { animation-duration: 1.6s; } }

/* ---- Login / denied gate ------------------------------------------------- */
.gate {
    max-width: 460px; margin: 40px auto; padding: 40px 28px; text-align: center;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.gate h1 { font-size: 24px; color: var(--ink-strong); margin: 4px 0 8px; line-height: 1.2; }
.gate .lead { color: var(--muted); font-size: 15px; margin: 0 auto 22px; max-width: 360px; }
.gate .btn-primary { width: 100%; }
.gate .hint { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.gate .nf-icon { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); }

/* ---- Full-screen auth state (login / denied card on navy) ---------------- */
body.auth-mode { background: linear-gradient(160deg, var(--brand-700) 0%, var(--brand) 100%); }
body.auth-mode .foot { display: none; }
body.auth-mode .wrap { max-width: none; margin: 0; padding: 0; }
.authwrap { min-height: calc(100vh - 63px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.authcard {
    width: 100%; max-width: 420px; background: var(--panel); border-radius: 16px;
    padding: 34px 32px 28px; text-align: center; border-top: 3px solid var(--red);
    box-shadow: 0 24px 60px rgba(8, 18, 40, .38);
}
.authcard .authlogo { height: 34px; margin: 0 0 18px; }
.authcard h1 { font-size: 22px; color: var(--ink-strong); margin: 0 0 8px; line-height: 1.25; }
.authcard .lead { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.authcard .btn-primary { width: 100%; background: var(--azure); border-color: var(--azure); }
.authcard .btn-primary:hover { background: var(--azure-ink); border-color: var(--azure-ink); }
.authcard .authalt { display: inline-block; margin-top: 16px; font-weight: 700; font-size: 13.5px; color: var(--brand); }
.authcard .nf-icon { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); }
.authcard .authnote { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ---- Dashboard hero ------------------------------------------------------ */
.hero { margin: 0 0 18px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.profile-link { flex: 0 0 auto; margin-top: 8px; }
.hero h1 { margin: 2px 0 3px; font-size: 26px; font-weight: 700; color: var(--ink-strong); letter-spacing: -.3px; }
.hero .sub { color: var(--muted); font-size: 15px; }

/* ---- Tabs ---------------------------------------------------------------- */
/* The grey baseline is an inset shadow (painted under the tabs) instead of a border the tabs overlap
   with a negative margin: that overlap stuck out 1px and, with overflow-x:auto, produced a vertical
   scrollbar. On narrow screens the tabs can still be swiped sideways, without a visible scrollbar. */
.tabs { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); margin: 0 0 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; white-space: nowrap; appearance: none; background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 14px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.panel { display: none; } .panel.active { display: block; }

/* ---- Stats --------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 20px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat-card .k { font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.stat-card .v { font-size: 26px; font-weight: 700; color: var(--ink-strong); margin-top: 4px; }

.subhead { font-size: 13px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }

/* ---- Work-order table ---------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.wo { width: 100%; border-collapse: collapse; font-size: 14px; }
table.wo th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.wo td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.wo tr:last-child td { border-bottom: 0; }
table.wo .mono { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-strong); }
table.wo .num { text-align: right; font-variant-numeric: tabular-nums; }
table.wo tr.wo-row { cursor: pointer; }
table.wo tr.wo-row:hover td { background: #f7f9fc; }
table.wo tr.wo-row:focus { outline: 2px solid var(--brand); outline-offset: -2px; }
.svc-tech { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.line-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag.notinv { background: #fff4e3; color: #96620a; }
.tag.disc { background: #e9f6ef; color: #16794a; }
table.wo tr.not-invoiced td { color: var(--muted); }

/* Work-order detail: service tasks with progress */
.tasks { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.task-row { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .tn { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-strong); }
.task-row .tp { display: flex; align-items: center; gap: 8px; flex: 0 0 140px; }
.task-row .bar { flex: 1; height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; }
.task-row .bar > span { display: block; height: 100%; background: var(--brand); }
.task-row .pct { font-size: 12px; font-weight: 700; color: var(--muted); width: 34px; text-align: right; }

.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef1f5; color: var(--muted); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.completed, .chip.posted { background: #e9f6ef; color: #16794a; }
.chip.scheduled { background: var(--azure-tint); color: var(--azure-ink); }
.chip.inprogress { background: #fff4e3; color: #96620a; }
.chip.unscheduled { background: #eef1f5; color: var(--muted); }
.chip.canceled { background: #fdeceb; color: #b3281f; }

.empty { background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---- Assets (Toestellen) ------------------------------------------------- */
.asset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.asset-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; }
.asset-top { display: flex; align-items: flex-start; gap: 12px; }
.asset-id { flex: 1; min-width: 0; }
.asset-card .an { font-weight: 700; color: var(--ink-strong); font-size: 14.5px; line-height: 1.25; }
.asset-card .am { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.asset-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.fact .k { font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.fact .v { font-size: 13.5px; color: var(--ink-strong); margin-top: 2px; }
.asset-log { align-self: flex-start; margin-top: auto; }
.asset-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.asset-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.asset-row:last-child { border-bottom: 0; }
.asset-row .an { font-weight: 600; color: var(--ink-strong); font-size: 13.5px; }
.asset-row .am { color: var(--muted); font-size: 12px; }
.dot-indoor { width: 8px; height: 8px; border-radius: 50%; background: var(--azure); flex: 0 0 auto; }

/* ---- Logbook detail ------------------------------------------------------ */
.lb-head { margin: 14px 0 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.lb-head h2 { margin: 0; font-size: 21px; color: var(--ink-strong); }
.lb-head .am { color: var(--muted); font-size: 14px; }
.lb-qr { flex: 0 0 auto; text-align: center; }
.lb-qr a { display: inline-block; text-decoration: none; }
.lb-qr img { display: block; width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lb-qr svg { display: block; width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lb-qr span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef1f5; color: var(--muted); }
.tag.install { background: var(--brand-tint); color: var(--brand); }
.tag.maint { background: #eef1f5; color: var(--muted); }
.tag.leak { background: var(--azure-tint); color: var(--azure-ink); }
.tag.repair { background: #fdeceb; color: #b3281f; }
.res { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; color: #16794a; }
.res.attention { color: #96620a; }
.res::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---- Footer -------------------------------------------------------------- */
.foot { margin-top: 36px; border-top: 1px solid var(--line); background: #fff; }
.foot-in { max-width: var(--maxw); margin: 0 auto; padding: 22px; }
.foot-logo { height: 24px; opacity: .9; }
.foot .legal { color: var(--muted); font-size: 12.5px; margin: 10px 0 6px; max-width: 70ch; }
.foot .contact { color: var(--muted); font-size: 12.5px; margin: 0; }

/* ---- Toast --------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink-strong); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Profile ------------------------------------------------------------- */
.profile-page { max-width: 760px; }
.profile-page > h1 { margin: 2px 0 4px; font-size: 26px; color: var(--ink-strong); line-height: 1.2; }
.profile-intro { margin: 0 0 20px; color: var(--muted); }
.profile-back {
    display: flex; width: max-content; margin: 0 0 18px; font-size: 13px; font-weight: 700;
    color: var(--brand);
}
.profile-form { display: flex; flex-direction: column; gap: 14px; }
.profile-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px 22px;
}
.profile-card h2 { margin: 0 0 16px; font-size: 16px; color: var(--ink-strong); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-card input[readonly] { background: var(--bg); color: var(--muted); cursor: default; }
.profile-note { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }
.profile-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-actions button:disabled { opacity: .65; cursor: wait; }
.profile-message { color: var(--muted); font-size: 13px; }
.profile-message.err, .profile-error { color: var(--err); font-weight: 600; }
.profile-error { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Sites: own account as a card that opens to show its sub accounts. */
.acct-card { margin-bottom: 14px; }
.acct-card h2 { margin-bottom: 4px; }
.acct-intro { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.acct-node {
    display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.acct-node.root { background: var(--bg); border-color: var(--line-strong); }
summary.acct-node { cursor: pointer; list-style: none; user-select: none; }
summary.acct-node::-webkit-details-marker { display: none; }
summary.acct-node:hover { border-color: var(--brand); }
summary.acct-node:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.acct-toggle {
    margin-left: auto; align-self: center; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--brand); white-space: nowrap;
}
.acct-chev { transition: transform .18s ease; }
.acct-group[open] .acct-chev { transform: rotate(180deg); }
.acct-subs { list-style: none; margin: 8px 0 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 8px; }
.acct-group:not([open]) > .acct-subs { display: none; }
.acct-subs .acct-node { margin-left: calc(var(--d, 0) * 22px); }
.acct-ic {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--brand);
}
.acct-node.root .acct-ic { background: var(--brand); color: #fff; }
.acct-body { min-width: 0; }
.acct-name { font-weight: 700; color: var(--ink-strong); line-height: 1.3; }
.acct-addr { margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.acct-addr.none { font-style: italic; }

@media (max-width: 660px) {
    .asset-grid { grid-template-columns: 1fr; }
    .specs { grid-template-columns: repeat(2, 1fr); }
    .stats { grid-template-columns: 1fr; }
    .hdr-in { gap: 10px; padding: 12px 16px; }
    .brandmark img { height: 26px; }
    .hdr-right { gap: 9px; }
    .hdr-user .who { display: none; }
    .hdr-meta .label { display: none; }
    .lang-btn { padding: 5px 9px; }
    .hdr-user .btn-ghost { height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; }
    .authwrap { min-height: calc(100vh - 53px); }
    .hero-top { gap: 12px; }
    .profile-link { margin-top: 0; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-card { padding: 18px 16px; }
    .acct-subs { padding-left: 12px; }
    .acct-subs .acct-node { margin-left: calc(var(--d, 0) * 12px); }
}

/* ---- Service request (case) --------------------------------------------- */
.panel .lead { color: var(--muted); font-size: 14px; margin: 0 0 16px; max-width: 520px; }
.caseform { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.casegrid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--ink-strong); }
.fld input, .fld textarea, .fld select {
    font-family: var(--font); font-size: 14px; color: var(--ink);
    background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-ctl);
    padding: 10px 12px; width: 100%; box-sizing: border-box;
}
.fld textarea { resize: vertical; min-height: 88px; }
.fld input:focus, .fld textarea:focus, .fld select:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
.case-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.case-msg { font-size: 13px; color: var(--muted); }
.case-msg.err { color: var(--err); font-weight: 600; }
.case-ok { text-align: center; padding: 26px 16px; max-width: 460px; margin: 0 auto; }
.case-ok-ic {
    width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(31, 157, 85, .12); color: var(--ok);
}
.case-ok h2 { font-size: 19px; color: var(--ink-strong); margin: 0 0 8px; font-weight: 700; }
.case-ok-body { color: var(--ink); font-size: 14.5px; margin: 0 0 18px; }
.case-ref { background: var(--brand-tint); border-radius: var(--radius); padding: 14px 18px; display: inline-block; margin: 0 auto 14px; }
.case-ref-k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.case-ref-v { font-size: 22px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; margin-top: 2px; }
.case-ok-keep { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

@media (max-width: 560px) {
    .casegrid2 { grid-template-columns: 1fr; }
}

.wo-signature { display: block; width: 100%; max-width: 340px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 4px; }


.task-block { border-bottom: 1px solid var(--line); }
.task-block:last-child { border-bottom: 0; }
.tasks .task-row { border-bottom: 0; }
.task-asset { width: 100%; display: flex; align-items: center; gap: 7px; padding: 2px 16px 10px 30px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; }
.task-asset:hover .ta-name { text-decoration: underline; }
.task-asset .ta-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.task-asset .ta-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-asset .chev { color: var(--muted); font-size: 14px; }
.ta-tech { display: flex; align-items: center; gap: 7px; padding: 2px 16px 10px 30px; }
.ta-tech .ta-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ta-tech .ta-name { font-size: 12.5px; font-weight: 600; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-details { border-top: 1px dashed var(--line); }
.cl-summary { list-style: none; cursor: pointer; padding: 9px 16px; font-weight: 700; font-size: 13px; color: var(--brand); display: flex; align-items: center; gap: 8px; user-select: none; }
.cl-summary::-webkit-details-marker { display: none; }
.cl-summary::before { content: "\25B8"; color: var(--muted); font-size: 11px; transition: transform .15s; }
.cl-details[open] > .cl-summary::before { transform: rotate(90deg); }
.cl-body { padding: 2px 16px 12px; background: var(--bg, #f7f9fc); }
.cl-item { padding: 9px 0; }
.cl-item + .cl-item { border-top: 1px solid var(--line); }
.cl-item-head { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.cl-status { font-weight: 600; font-size: 11.5px; color: var(--muted); }
.cl-status.done { color: #1e7a46; }
.cl-a-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.cl-q { color: var(--muted); }
.cl-a { font-weight: 600; text-align: right; white-space: pre-wrap; }

/* ---- v0.10: wider layout for the compliance dashboard and tables ---------- */
:root { --maxw: 1120px; }
.hero-actions { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.site-pick { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.site-pick select, .toolbar .search {
    font-family: var(--font); font-size: 13.5px; color: var(--ink); background: #fff;
    border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; min-width: 220px;
}
.site-pick select:focus, .toolbar .search:focus { outline: 2px solid var(--azure); outline-offset: 1px; border-color: var(--azure); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 280px; max-width: 420px; }
.toolbar .count { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lead { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.btn-md { padding: 8px 16px; font-size: 14px; border-radius: 8px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.nowrap { white-space: nowrap; }
table.wo .an { font-weight: 700; color: var(--ink-strong); line-height: 1.3; }
table.wo .am, .lb-note + .am { font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.subhead.site-head { margin-top: 22px; color: var(--brand); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 22px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-top: 3px solid var(--line-strong); }
.kpi[data-goto] { cursor: pointer; }
.kpi[data-goto]:hover { border-color: var(--brand); }
.kpi .k { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 28px; font-weight: 700; color: var(--ink-strong); line-height: 1.15; margin-top: 4px; }
.kpi .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.ok { border-top-color: var(--ok); } .kpi.ok .v { color: #16794a; }
.kpi.warn { border-top-color: var(--warn); } .kpi.warn .v { color: #96620a; }
.kpi.err { border-top-color: var(--red); } .kpi.err .v { color: #b3281f; }

/* Action list (overview) */
.action-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.action-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; font-family: var(--font); }
.action-row:last-child { border-bottom: 0; }
.action-row:hover { background: #f7f9fc; }
.ar-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.ar-dot.err { background: var(--red); } .ar-dot.warn { background: var(--warn); }
.ar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ar-title { font-weight: 700; color: var(--ink-strong); font-size: 14px; }
.ar-sub { font-size: 12.5px; color: var(--muted); }
.ar-when { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ar-when.err { color: #b3281f; } .ar-when.warn { color: #96620a; }
.ar-sched { font-size: 12.5px; font-weight: 600; color: var(--azure-ink); margin-top: 2px; }
.action-row .chev, .task-asset .chev { color: var(--muted); font-size: 18px; }
.allgood { display: flex; align-items: center; gap: 14px; background: #e9f6ef; border: 1px solid #c6e8d4; color: #16794a; border-radius: var(--radius); padding: 14px 18px; font-size: 14px; }
.allgood strong { color: #10603a; }

/* Status chips (installations) */
.chip.st-ok { background: #e9f6ef; color: #16794a; }
.chip.st-warn { background: #fff4e3; color: #96620a; }
.chip.st-err { background: #fdeceb; color: #b3281f; }
.chip.st-neutral { background: #eef1f5; color: var(--muted); }

/* Logbook */
.banner { margin-top: 12px; display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.banner.err { background: #fdecea; border: 1px solid #f5c6c2; color: #b42318; }
.banner.warn { background: #fff8e6; border: 1px solid #f3dca5; color: #8a5a00; }
.plans { display: flex; flex-wrap: wrap; gap: 8px; }
.plan { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--azure-tint); color: var(--azure-ink); font-size: 12.5px; font-weight: 700; }
.plan.err { background: #fdeceb; color: #b3281f; }
.instructions { white-space: pre-wrap; font-size: 13px; color: #1b2733; background: #f6f8fb; border: 1px solid #e3e8ef; border-radius: 8px; padding: 10px 12px; }
.lb-note { font-size: 13px; color: var(--ink-strong); margin-top: 4px; }
.tag.refrigerant { background: #fff4e3; color: #96620a; }
.mv { font-weight: 700; font-variant-numeric: tabular-nums; }
.mv.add { color: #b3281f; } .mv.rec { color: #16794a; }
.linkish { appearance: none; border: 0; background: none; padding: 0; margin-top: 2px; font-family: var(--font); font-size: 12.5px; font-weight: 600; color: var(--brand); cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
.att-link { font-weight: 700; white-space: nowrap; }
table.logbook td { vertical-align: top; }
@media (max-width: 860px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .hero-top { flex-direction: column; }
    .hero-actions { justify-content: flex-start; }
    .specs { grid-template-columns: repeat(2, 1fr); }
}

/* Shared documents */
.doc-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: #f7f9fc; text-decoration: none; }
.doc-ic { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px; background: var(--brand-tint); color: var(--brand); font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-name { font-weight: 700; color: var(--ink-strong); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-sub { font-size: 12px; color: var(--muted); }
.panel-loading.small { padding: 14px; }
.fld .hint { color: var(--muted); font-size: 12px; }

/* Request photos: a calm drop zone (outlined, not a second filled button) + thumbnails */
.sr-only, .fld input.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photo-drop { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1.5px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; }
.photo-drop:hover, .photo-drop.over { border-color: var(--brand); background: #f7f9fd; }
.photo-drop:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.photo-drop.full { opacity: .55; pointer-events: none; }
.pd-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.pd-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-txt b { color: var(--brand); font-size: 14px; }
.pd-txt small { color: var(--muted); font-size: 12px; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.photo-thumbs:empty { display: none; }
.pt { position: relative; margin: 0; width: 92px; }
.pt img { width: 92px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.pt figcaption { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.pt-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(255,255,255,.95); color: var(--ink); font-size: 14px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.pt-x:hover { color: #b3281f; border-color: #b3281f; }
.pt-count { font-size: 12px; color: var(--muted); padding-bottom: 20px; }

/* Work order before invoicing */
.info-note { margin-top: 20px; background: var(--azure-tint); border: 1px solid #c4e6f5; color: var(--azure-ink); border-radius: var(--radius); padding: 12px 16px; font-size: 13.5px; font-weight: 600; }
.muted-v { color: var(--muted); font-style: italic; }

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

/* Request detail ("stand van zaken"): messages from Maes (left) and the customer (right), reply box.
   A long conversation scrolls inside its own box (opened at the newest message). */
.case-thread { display: flex; flex-direction: column; gap: 10px; max-width: 760px; max-height: 60vh; overflow-y: auto; padding: 4px 8px 6px 2px; }
.msg { flex-shrink: 0; max-width: 82%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; }
.msg.in { align-self: flex-end; background: var(--azure-tint); border-color: #c4e6f5; }
.msg-meta { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.msg-text { font-size: 14px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.case-reply { margin-top: 14px; max-width: 760px; }
.case-reply .fld textarea { min-height: 72px; }
.case-desc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 760px; }
.case-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.case-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.case-photos + .case-add-photos { margin-top: 14px; }
.case-add-photos { max-width: 760px; }
.case-desc.editable { position: relative; padding-right: 48px; }
.case-edit-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    appearance: none; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.case-edit-btn:hover, .case-edit-btn:focus-visible { color: var(--brand); background: var(--brand-tint); border-color: var(--line); outline: none; }
/* ---- Help: ⓘ tips + /help page (v0.14.0) -------------------------------- */
.help-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; text-transform: none; letter-spacing: 0; }
.help-i { appearance: none; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--azure); background: #fff; color: var(--azure-ink);
    font: italic 700 11px/1 Georgia, "Times New Roman", serif; display: inline-flex; align-items: center; justify-content: center; cursor: help; padding: 0; }
.help-i:hover, .help-tip.open .help-i, .help-i:focus-visible { background: var(--azure); color: #fff; outline: none; }
.help-pop { display: none; position: absolute; z-index: 40; top: calc(100% + 9px); left: -12px; width: 290px; max-width: calc(100vw - 32px);
    background: #fff; border: 1px solid var(--line-strong); border-top: 3px solid var(--azure); border-radius: 10px; box-shadow: 0 10px 28px rgba(16, 42, 82, .18);
    padding: 11px 14px 12px; text-align: left; white-space: normal; cursor: default;
    font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--ink); text-transform: none; letter-spacing: 0; }
.help-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -13px; height: 13px; }
.help-pop strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-strong); margin-bottom: 3px; }
.help-pop > span { display: block; }
.help-pop a { display: block; margin-top: 7px; font-weight: 700; font-size: 12.5px; }
.help-tip:hover .help-pop, .help-tip:focus-within .help-pop, .help-tip.open .help-pop { display: block; }
.help-tip.flip .help-pop { left: auto; right: -12px; }
.kpi .help-pop { top: calc(100% + 7px); }
.help-link { margin-top: 8px; }

.help-page { max-width: 820px; }
.help-page > h1 { margin: 2px 0 4px; font-size: 26px; color: var(--ink-strong); line-height: 1.2; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 22px; }
.help-toc a { padding: 6px 12px; border-radius: 999px; background: var(--azure-tint); color: var(--azure-ink); font-size: 13px; font-weight: 700; }
.help-toc a:hover { background: var(--azure); color: #fff; text-decoration: none; }
.help-topic { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px 22px 14px; margin: 0 0 14px; scroll-margin-top: 16px; transition: box-shadow .4s, border-color .4s; }
.help-topic.flash { border-color: var(--azure); box-shadow: 0 0 0 3px var(--azure-tint), var(--shadow); }
.help-topic h2 { margin: 0 0 6px; font-size: 18px; color: var(--ink-strong); }
.help-topic .help-sum { margin: 0 0 10px; font-weight: 600; color: var(--azure-ink); }
.help-topic p, .help-topic li { font-size: 14.5px; }
.help-topic ul { margin: 0 0 10px; padding-left: 20px; }
.help-topic table { width: 100%; border-collapse: collapse; margin: 4px 0 12px; font-size: 13.5px; }
.help-topic th { text-align: left; background: var(--brand-tint); color: var(--ink-strong); padding: 7px 10px; font-weight: 700; }
.help-topic td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.help-topic td:first-child { white-space: nowrap; }
.help-top { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.help-contact { border-left: 3px solid var(--red); }
@media (max-width: 560px) { .help-topic td:first-child { white-space: normal; } .help-pop { width: 250px; } }
