/* ============================================================
 * dashboard-ui.css  -  shared "readable, hierarchical" layer for the staff / leader / master-trainer dashboards
 * ------------------------------------------------------------
 * Pairs with tiko-dash-ui.js (window.TikoDU). Every class is prefixed `du-`.
 * Reuses the colour tokens of tiko-dash.css (--dv-ok / watch / crit / neutral / mute) so the purple brand and rounded cards stay.
 *
 * SYSTEM
 *   Spacing   4 / 8 / 12 / 16 / 24 / 32  (--du-1 .. --du-6)
 *   Type      page title 26-28, section 18, row title 16 (bold), body 15-16, secondary 14, caption 13 (never below 13 except badges 12)
 *   Targets   every button / chip / select / row action is >= 44px high on touch, >= 40px with a mouse
 *   Status    colour + icon + words, never colour alone:
 *             overdue = crit (red)   needs action = watch (gold)   waiting on others = neutral (purple)   done = ok (teal)
 *   Pattern   header (one plain sentence) -> 3-4 ranked KPI tiles -> compact filter bar -> priority groups -> cards (one chip, one primary action)
 *             -> details in a drawer / expand (progressive disclosure).  Tables: sticky header + zebra on desktop, stacked cards on phones.
 * ============================================================ */
:root {
    --du-1: 4px; --du-2: 8px; --du-3: 12px; --du-4: 16px; --du-5: 24px; --du-6: 32px;
    --du-ink: #0F172A; --du-ink-2: #475569; --du-line: #E2E8F0; --du-bg: #FFFFFF; --du-soft: #F8FAFC;
    --du-brand: #702082; --du-brand-bg: #F3E8FA; --du-focus: #702082;
    --du-r: 16px; --du-r-sm: 12px;
    --du-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 18px -12px rgba(15,23,42,.18);
}
.du, .du * { box-sizing: border-box; }
.du { color: var(--du-ink); font-size: 16px; line-height: 1.5; }
.du :focus-visible, .du-drawer :focus-visible, .du-sheet-x :focus-visible { outline: 3px solid var(--du-focus); outline-offset: 2px; border-radius: 8px; }
.du-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page header ---------- */
.du-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--du-3) var(--du-5); margin: 0 0 var(--du-4); }
.du-head .t { flex: 1 1 320px; min-width: 0; }
.du-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--du-brand); }
.du-title { margin: 2px 0 0; font-family: 'Plus Jakarta Sans', Inter, sans-serif; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.du-summary { margin: var(--du-2) 0 0; font-size: 17px; line-height: 1.45; color: var(--du-ink-2); font-weight: 500; max-width: 62ch; }
.du-summary b { color: var(--du-ink); font-weight: 700; }
.du-actions { display: flex; flex-wrap: wrap; gap: var(--du-2); align-items: center; }

/* ---------- buttons ---------- */
.du-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--du-line); background: #fff; color: var(--du-ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.du-btn:hover { border-color: var(--du-brand); color: var(--du-brand); }
.du-btn.primary { background: var(--du-brand); border-color: var(--du-brand); color: #fff; }
.du-btn.primary:hover { background: #5b1a69; border-color: #5b1a69; color: #fff; }
.du-btn.quiet { border-color: transparent; background: transparent; color: var(--du-ink-2); }
.du-btn.quiet:hover { background: var(--du-soft); color: var(--du-brand); }
.du-btn.danger { color: var(--dv-crit); border-color: #F4B8B1; }
.du-btn.sm { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.du-btn[disabled], .du-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.du-btn i { font-size: 18px; }
@media (hover: none) and (pointer: coarse) { .du-btn.sm { min-height: 44px; } }

/* ---------- KPI tiles (ranked: the first one is the most important) ---------- */
.du-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--du-3); margin: 0 0 var(--du-5); }
/* 2026-10-27: restyled to the ORIGINAL staff KPI card look (white 18px card, small uppercase label, big number, icon chip top-right), as the owner asked. */
.du-kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0; text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid var(--du-line); border-radius: 18px; padding: 18px 20px; box-shadow: 0 4px 16px -2px rgba(0,0,0,.03); min-height: 96px; cursor: default; }
button.du-kpi { cursor: pointer; }
button.du-kpi:hover { border-color: var(--du-brand); }
.du-kpi .l { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--du-ink-2); margin: 0 44px 8px 0; display: block; }
.du-kpi .l i { display: none; }
.du-kpi .v { font-family: 'Plus Jakarta Sans', Inter, sans-serif; font-size: 28px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--du-ink); }
.du-kpi.crit .v { color: var(--dv-crit); } .du-kpi.ok .v { color: var(--dv-ok); }
.du-kpi .h { font-size: 12px; font-weight: 600; color: var(--du-ink-2); margin-top: 6px; }
.du-kpi .ico { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: #F3E8FA; color: #702082; }
.du-kpi.crit .ico { background: #FEF2F2; color: #DC2626; } .du-kpi.watch .ico { background: #FEF3C7; color: #B45309; }
.du-kpi.ok .ico { background: #ECFDF5; color: #047857; } .du-kpi.neutral .ico { background: #E0F2FE; color: #0E7490; }

/* ---------- CBO ranking score cell (staff-dashboard.html cboScoreCell) ---------- */
.lb-cell { min-width: 150px; }
.lb-score { display: block; font-family: 'Plus Jakarta Sans', Inter, sans-serif; font-size: 20px; font-weight: 900; color: #4A1556; }
.lb-bar { display: flex; height: 6px; margin: 4px auto 2px; border-radius: 4px; overflow: hidden; background: #EEF2F6; max-width: 140px; }
.lb-bar i { display: block; height: 100%; }
.lb-note { font-size: 12.5px; color: #64748B; margin-top: 4px; }
.lb-sub { font-size: 12.5px; color: #64748B; }
.lb-dash { color: #94A3B8; font-weight: 800; }
.lb-small td { opacity: .85; }
.lb-rk { display: inline-block; min-width: 22px; padding: 0 6px; margin-right: 4px; border-radius: 99px; background: #F3E8FA; color: #702082; font-size: 12px; font-weight: 800; text-align: center; }
.lb-why { margin-top: 4px; text-align: center; }
.lb-why > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: #702082; list-style: none; min-height: 24px; }
.lb-why > summary::-webkit-details-marker { display: none; }
.lb-why > summary::before { content: "\25B8\00a0"; }
.lb-why[open] > summary::before { content: "\25BE\00a0"; }
.lb-why ul { list-style: none; text-align: left; margin: 6px auto 4px; padding: 8px 10px; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 10px; min-width: 250px; }
.lb-why li { display: grid; grid-template-columns: 10px 1fr auto; column-gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.4; padding: 3px 0; }
.lb-why .lb-dot { width: 8px; height: 8px; border-radius: 50%; }
.lb-why .lb-v { grid-column: 2 / 3; color: #475569; font-size: 12.5px; }
.lb-why .lb-p { grid-row: 1 / 3; grid-column: 3; font-weight: 800; color: #0F172A; white-space: nowrap; }
.lb-why .lb-l { font-weight: 700; }

/* ---------- compact filter bar ---------- */
.du-filters { display: flex; flex-wrap: wrap; gap: var(--du-2); align-items: flex-end; background: var(--du-bg); border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-3); margin: 0 0 var(--du-3); }
.du-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.du-field > label, .du-field > .lb { font-size: 13px; font-weight: 700; color: var(--du-ink-2); }
.du-field select, .du-field input[type=search], .du-field input[type=text], .du-field input[type=date] { min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--du-line); border-radius: var(--du-r-sm); font: inherit; font-size: 15px; background: #fff; color: var(--du-ink); max-width: 100%; }
.du-field select:hover, .du-field input:hover { border-color: #B8C2CF; }
.du-field.grow { flex: 1 1 220px; }
.du-field.sel { flex: 0 1 220px; }
.du-filters .sp { flex: 1 1 0; }
.du-fbtn { display: none; }
.du-active { display: flex; flex-wrap: wrap; gap: var(--du-2); align-items: center; margin: 0 0 var(--du-4); font-size: 14px; color: var(--du-ink-2); }
.du-active:empty { display: none; }
.du-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--du-line); background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--du-ink); }
button.du-chip { cursor: pointer; min-height: 40px; }
button.du-chip:hover { border-color: var(--du-brand); color: var(--du-brand); }
.du-chip.on { background: var(--du-brand-bg); border-color: var(--du-brand); color: var(--du-brand); }
.du-chip .n { font-weight: 700; opacity: .8; }
.du-seg { display: inline-flex; background: #EEF2F6; border-radius: 999px; padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.du-seg button { min-height: 44px; padding: 8px 18px; border: 0; background: transparent; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; color: var(--du-ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.du-seg button[aria-selected="true"], .du-seg button.on { background: #fff; color: var(--du-brand); box-shadow: 0 1px 3px rgba(15,23,42,.14); }
.du-seg .n { background: var(--dv-crit-bg); color: var(--dv-crit); border-radius: 999px; padding: 0 8px; font-size: 13px; min-width: 24px; text-align: center; }
.du-menu { position: relative; }
.du-menu > summary { list-style: none; }
.du-menu > summary::-webkit-details-marker { display: none; }
.du-menu .pop { position: absolute; z-index: 25; right: 0; top: calc(100% + 6px); width: min(340px, calc(100vw - 32px)); max-height: 360px; overflow: auto; background: #fff; border: 1px solid var(--du-line); border-radius: var(--du-r-sm); box-shadow: 0 16px 40px -12px rgba(15,23,42,.3); padding: var(--du-2); }
.du-menu .pop .hd { font-size: 13px; font-weight: 700; color: var(--du-ink-2); padding: 8px 12px 4px; text-transform: uppercase; letter-spacing: .05em; }
.du-menu .pop button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border: 0; background: transparent; border-radius: 10px; font: inherit; font-size: 15px; text-align: left; cursor: pointer; color: var(--du-ink); }
.du-menu .pop button:hover { background: var(--du-brand-bg); }
@media (max-width: 768px) {
    .du-filters { position: static; }
    .du-filters .du-field.sel { display: none; }
    .du-fbtn { display: inline-flex; }
    .du-field.grow { flex: 1 1 100%; }
    .du-title { font-size: 24px; } .du-summary { font-size: 16px; }
    .du-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--du-2); }
    .du-kpi { padding: 14px 16px; min-height: 88px; } .du-kpi .v { font-size: 24px; } .du-kpi .ico { top: 12px; right: 12px; width: 32px; height: 32px; font-size: 16px; }
}

/* ---------- priority groups ---------- */
.du-group { margin: 0 0 var(--du-4); }
.du-group > summary { list-style: none; display: flex; align-items: center; gap: var(--du-3); min-height: 52px; padding: var(--du-2) var(--du-3); cursor: pointer; border-radius: var(--du-r-sm); user-select: none; }
.du-group > summary::-webkit-details-marker { display: none; }
.du-group > summary:hover { background: rgba(112,32,130,.05); }
.du-group .gi { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.du-group .gt { font-size: 18px; font-weight: 800; font-family: 'Plus Jakarta Sans', Inter, sans-serif; }
.du-group .gh { font-size: 14px; color: var(--du-ink-2); margin-top: 1px; font-weight: 500; }
.du-group .gx { flex: 1; min-width: 0; }
.du-group .gn { font-size: 14px; font-weight: 800; border-radius: 999px; padding: 2px 12px; min-width: 32px; text-align: center; }
.du-group > summary::after { content: ""; flex: 0 0 auto; width: 9px; height: 9px; border-right: 2.5px solid #64748B; border-bottom: 2.5px solid #64748B; transform: rotate(45deg); margin: 0 6px 4px 4px; transition: transform .18s; }
.du-group[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.du-group.crit .gi, .du-group.crit .gn { background: var(--dv-crit-bg); color: var(--dv-crit); }
.du-group.watch .gi, .du-group.watch .gn { background: var(--dv-watch-bg); color: var(--dv-watch); }
.du-group.neutral .gi, .du-group.neutral .gn { background: var(--dv-neutral-bg); color: var(--dv-neutral); }
.du-group.ok .gi, .du-group.ok .gn { background: var(--dv-ok-bg); color: var(--dv-ok); }
.du-group .gb { display: grid; gap: var(--du-2); padding: var(--du-1) 0 0; }

/* ---------- list cards ---------- */
.du-card { position: relative; display: flex; align-items: center; gap: var(--du-4); background: var(--du-bg); border: 1px solid var(--du-line); border-left: 5px solid var(--dv-mute-fill); border-radius: var(--du-r); padding: var(--du-3) var(--du-4); box-shadow: var(--du-shadow); }
.du-card.crit { border-left-color: var(--dv-crit-fill); } .du-card.watch { border-left-color: var(--dv-watch-fill); }
.du-card.neutral { border-left-color: var(--dv-neutral-fill); } .du-card.ok { border-left-color: var(--dv-ok-fill); }
.du-card.click { cursor: pointer; }
.du-card.click:hover { border-color: #C9A3D2; box-shadow: 0 8px 22px -12px rgba(112,32,130,.5); }
.du-av { width: 44px; height: 44px; border-radius: 50%; background: var(--du-brand-bg); color: var(--du-brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex: 0 0 auto; }
.du-card .bd { flex: 1 1 auto; min-width: 0; }
.du-card .p { font-size: 17px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.du-card .s { font-size: 15px; line-height: 1.4; color: var(--du-ink); margin-top: 2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.du-card .c { font-size: 14px; color: var(--du-ink-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.du-card .c span { display: inline-flex; align-items: center; gap: 4px; }
.du-card .rt { display: flex; flex-direction: column; align-items: flex-end; gap: var(--du-2); flex: 0 0 auto; }
.du-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; background: var(--dv-mute-bg); color: var(--dv-mute); }
.du-status.crit { background: var(--dv-crit-bg); color: var(--dv-crit); } .du-status.watch { background: var(--dv-watch-bg); color: var(--dv-watch); }
.du-status.neutral { background: var(--dv-neutral-bg); color: var(--dv-neutral); } .du-status.ok { background: var(--dv-ok-bg); color: var(--dv-ok); }
.du-status i { font-size: 16px; }
@media (max-width: 768px) {
    .du-card { flex-wrap: wrap; align-items: flex-start; gap: var(--du-3); padding: var(--du-3); }
    .du-card .bd { flex: 1 1 calc(100% - 60px); }
    .du-card .rt { flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .du-card .rt .du-btn { flex: 1 1 auto; }
    .du-card .p { font-size: 16px; }
}

/* ---------- empty / skeleton / error ---------- */
.du-empty { text-align: center; padding: var(--du-6) var(--du-4); display: flex; flex-direction: column; align-items: center; gap: var(--du-2); background: var(--du-bg); border: 1px dashed #CBD5E1; border-radius: var(--du-r); }
.du-empty .ic { width: 64px; height: 64px; border-radius: 50%; background: var(--du-brand-bg); color: var(--du-brand); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.du-empty.ok .ic { background: var(--dv-ok-bg); color: var(--dv-ok); } .du-empty.crit .ic { background: var(--dv-crit-bg); color: var(--dv-crit); }
.du-empty h3 { margin: var(--du-2) 0 0; font-size: 20px; font-weight: 800; }
.du-empty p { margin: 0; max-width: 46ch; font-size: 16px; color: var(--du-ink-2); }
.du-empty .du-btn { margin-top: var(--du-2); }
.du-skel { display: grid; gap: var(--du-3); }
.du-skel .sk { background: linear-gradient(90deg, #EEF1F5 0%, #F8FAFC 50%, #EEF1F5 100%); background-size: 200% 100%; animation: du-shim 1.3s linear infinite; border-radius: var(--du-r-sm); }
.du-skel .k { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--du-3); } .du-skel .k .sk { height: 104px; }
.du-skel .r { height: 84px; border-radius: var(--du-r); } .du-skel .h { height: 28px; width: 40%; }
@keyframes du-shim { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .du-skel .sk { animation: none; } .du-drawer, .du-sheet-x { transition: none !important; } }

/* ---------- drawer (right side on desktop, bottom sheet on phones) ---------- */
.du-ov { position: fixed; inset: 0; z-index: 8990; background: rgba(31,18,38,.45); opacity: 0; transition: opacity .18s; }
.du-ov.on { opacity: 1; }
.du-drawer { position: fixed; z-index: 9000; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; display: flex; flex-direction: column; box-shadow: -16px 0 48px rgba(15,23,42,.25); transform: translateX(24px); opacity: 0; transition: transform .2s, opacity .2s; font-size: 16px; color: var(--du-ink); }
.du-drawer.on { transform: none; opacity: 1; }
body.previewing .du-drawer { top: 44px; }
.du-drawer .dh { display: flex; gap: var(--du-3); align-items: flex-start; padding: var(--du-4) var(--du-5); border-bottom: 1px solid var(--du-line); }
.du-drawer .dh .tx { flex: 1; min-width: 0; }
.du-drawer .dh h2 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; font-family: 'Plus Jakarta Sans', Inter, sans-serif; overflow-wrap: anywhere; }
.du-drawer .dh .sub { font-size: 15px; color: var(--du-ink-2); margin-top: 2px; }
.du-drawer .db { flex: 1; overflow: auto; padding: var(--du-4) var(--du-5); display: grid; gap: var(--du-5); align-content: start; -webkit-overflow-scrolling: touch; }
.du-drawer .df { border-top: 1px solid var(--du-line); padding: var(--du-3) var(--du-5); display: flex; flex-wrap: wrap; gap: var(--du-2); background: var(--du-soft); }
.du-drawer .df .du-btn { flex: 1 1 auto; }
.du-x-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--du-ink-2); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.du-x-btn:hover { background: var(--du-soft); color: var(--du-brand); }
.du-sec > h3 { margin: 0 0 var(--du-2); font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--du-ink-2); }
.du-sec p { margin: 0; font-size: 16px; }
.du-callout { background: #F1F8F6; border: 1px solid #BFE3D8; border-left: 5px solid var(--dv-ok-fill); border-radius: var(--du-r-sm); padding: var(--du-3) var(--du-4); font-size: 16px; }
.du-callout b { display: block; font-size: 14px; color: var(--dv-ok); margin-bottom: 2px; }
.du-kv { display: grid; grid-template-columns: auto 1fr; gap: var(--du-1) var(--du-4); font-size: 15px; margin: 0; }
.du-kv dt { color: var(--du-ink-2); font-weight: 600; } .du-kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.du-time { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: var(--du-3); }
.du-time::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--du-line); }
.du-time li { position: relative; display: flex; gap: var(--du-3); align-items: flex-start; }
.du-time .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--du-brand-bg); color: var(--du-brand); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 auto; z-index: 1; border: 3px solid #fff; }
.du-time li.sys .dot { background: var(--dv-mute-bg); color: var(--dv-mute); }
.du-time .tx { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--du-soft); border-radius: var(--du-r-sm); padding: 8px 12px; flex: 1; min-width: 0; }
.du-time li.sys .tx { background: transparent; padding: 4px 0; color: var(--du-ink-2); }
.du-time .mt { display: block; font-size: 13px; color: var(--du-ink-2); margin-top: 2px; white-space: normal; }
.du-textarea { width: 100%; border: 1.5px solid var(--du-line); border-radius: var(--du-r-sm); padding: 10px 12px; font: inherit; font-size: 16px; resize: vertical; min-height: 88px; }
.du-form { display: grid; gap: var(--du-3); }
.du-form label { font-size: 14px; font-weight: 700; color: var(--du-ink-2); display: grid; gap: 4px; }
.du-form select { min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--du-line); border-radius: var(--du-r-sm); font: inherit; font-size: 16px; background: #fff; }
.du-form .row { display: flex; gap: var(--du-2); flex-wrap: wrap; }
.du-form .row .du-btn { flex: 1 1 auto; }
.du-err { color: var(--dv-crit); font-weight: 700; font-size: 15px; }
@media (max-width: 768px) {
    .du-drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; transform: translateY(32px); box-shadow: 0 -16px 48px rgba(15,23,42,.3); }
    body.previewing .du-drawer { top: auto; }
    .du-drawer .dh { padding: var(--du-3) var(--du-4); } .du-drawer .db { padding: var(--du-4); } .du-drawer .df { padding: var(--du-3) var(--du-4); }
    .du-drawer::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: #CBD5E1; margin: 8px auto 0; flex: 0 0 auto; }
}

/* ---------- error box ---------- */
.du-errbox { display: flex; gap: var(--du-3); align-items: flex-start; background: #FEF6F5; border: 1px solid #F4B8B1; border-left: 5px solid var(--dv-crit-fill); border-radius: var(--du-r); padding: var(--du-4); }
.du-errbox .ic { font-size: 28px; color: var(--dv-crit); }
.du-errbox h3 { margin: 0; font-size: 18px; font-weight: 800; } .du-errbox p { margin: 2px 0 var(--du-2); font-size: 15px; color: var(--du-ink-2); }

/* ---------- responsive tables (every .data-table inside #content, see TikoDU.tables) ---------- */
#content table.data-table.du-table { font-size: 15px; border-collapse: separate; border-spacing: 0; width: 100%; }
#content table.data-table.du-table th { font-size: 13px; letter-spacing: .04em; padding: 12px 14px; background: #F8FAFC; color: var(--du-ink-2); border-bottom: 2px solid var(--du-line); white-space: nowrap; }
#content table.data-table.du-table td { padding: 14px; border-bottom: 1px solid #EDF1F5; font-size: 15px; vertical-align: middle; }
#content table.data-table.du-table tbody tr:nth-child(even) td { background: #FBFCFD; }
#content table.data-table.du-table tbody tr:hover td { background: #F6EEF8; }
#content table.data-table.du-table tbody tr.clickable { cursor: pointer; }
#content table.data-table.du-table th .du-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 28px; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; font-weight: 800; }
#content table.data-table.du-table th .du-sort:hover { color: var(--du-brand); }
#content table.data-table.du-table th .du-sort:focus-visible { outline: 3px solid var(--du-focus); outline-offset: 2px; }
#content table.data-table.du-table th[aria-sort="ascending"] .du-sort::after { content: "\2191"; } #content table.data-table.du-table th[aria-sort="descending"] .du-sort::after { content: "\2193"; }
#content table.data-table.du-table th[aria-sort="ascending"], #content table.data-table.du-table th[aria-sort="descending"] { color: var(--du-brand); }
.du-twrap.stick { overflow: visible !important; }
.du-twrap.stick table.du-table thead th { position: sticky; top: var(--dv-sticky-top, 128px); z-index: 5; }
@media (max-width: 640px) {
    #content table.data-table.du-table, #content table.data-table.du-table tbody { display: block; }
    #content table.data-table.du-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    #content table.data-table.du-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-3); margin: 0 0 var(--du-2); background: #fff; box-shadow: var(--du-shadow); }
    #content table.data-table.du-table tbody tr:nth-child(even) td, #content table.data-table.du-table tbody tr:hover td { background: transparent; }
    #content table.data-table.du-table td { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; padding: 4px 0; text-align: left !important; font-size: 16px; min-width: 0; }
    #content table.data-table.du-table td:first-child { grid-column: 1 / -1; font-size: 17px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid #EDF1F5; margin-bottom: 4px; }
    #content table.data-table.du-table td[data-label]:not(:first-child)::before { content: attr(data-label); font-size: 13px; font-weight: 700; color: var(--du-ink-2); }
    #content table.data-table.du-table td:first-child::before { content: none; }
    #content table.data-table.du-table td.lb-cell { grid-column: 1 / -1; }
    .lb-bar { margin-left: 0; max-width: 100%; width: 160px; }
    .lb-why ul { min-width: 0; width: 100%; }
    .lb-why { text-align: left; }
    .lb-why > summary { display: flex; align-items: center; min-height: 44px; }   /* phone tap target >= 44px */
    details.du-how > summary { min-height: 44px; }
}

/* ---------- global readability bumps inside the dashboard content (legacy classes keep working) ---------- */
#content .section-title { font-size: 22px; line-height: 1.25; }
#content .section-sub, #content .card-sub { font-size: 14px; line-height: 1.5; color: var(--du-ink-2); }
#content .card-title { font-size: 17px; }
#content .pill { font-size: 12.5px; padding: 3px 10px; }
#content .empty-block { font-size: 15px; padding: 48px 20px; }
@media (max-width: 768px) {
    #content .section-title { font-size: 20px; }
    #content .card-body { padding: 14px; }
    .nav-tab { min-height: 48px; font-size: 14px; }
}

/* ---------- small helpers ---------- */
.du-how { margin: 0 0 var(--du-4); font-size: 15px; color: var(--du-ink-2); }
.du-how > summary { cursor: pointer; font-weight: 700; color: var(--du-brand); min-height: 32px; display: inline-flex; align-items: center; }
.du-how > p { margin: var(--du-1) 0 0; max-width: 70ch; line-height: 1.5; }
.ib-toast { font-size: 15px !important; padding: 12px 18px !important; border-radius: 12px !important; }
body.du-dr-open .ta-fab-wrap { display: none !important; }   /* the AI helper button must never cover drawer actions */
body.du-dr-open { overflow: hidden; }
#content { padding-bottom: 96px; }
.du-sec ul { list-style: disc; }

.du-sec-t { margin: 0 0 8px; font-size: 18px; font-weight: 800; font-family: 'Plus Jakarta Sans', Inter, sans-serif; }

/* ---------- readability lift for the older dv-* screens (People, Cohort, Hierarchy, Structure ...) ---------- */
#content .dv { font-size: 15px; line-height: 1.5; }
#content .dv-title { font-size: 26px; line-height: 1.2; }
#content .dv-sub { font-size: 15px; color: var(--du-ink-2); }
#content .dv-sec { font-size: 13px; letter-spacing: .06em; }
#content .dv-small { font-size: 14px; }
#content .dv-kpi .l { font-size: 13px; letter-spacing: .05em; }
#content .dv-kpi .v { font-size: 30px; }
#content .dv-kpi .s { font-size: 14px; }
#content .dv-chip { font-size: 13px; padding: 3px 10px; }
#content button.dv-chip { min-height: 40px; }
#content .dv-btn { font-size: 14px; min-height: 40px; padding: 6px 14px; }
#content .dv-btn.sm { font-size: 13.5px; min-height: 40px; }
#content .dv-tabs button { font-size: 15px; min-height: 44px; }
#content .dv-hb .lb { font-size: 15px; } #content .dv-hb .sb { font-size: 13.5px; }
#content .dv-ecard .nm { font-size: 16px; } #content .dv-ecard .kv { font-size: 14px; }
#content .dv-fbar select, #content .dv-fbar input[type=search] { font-size: 15px; min-height: 44px; }
#content .dv-pc-t { font-size: 15.5px; } #content .dv-sugg { font-size: 14.5px; }
#content details.dv-x > summary { min-height: 52px; font-size: 15px; }
#content .dv-empty { font-size: 15px; }
#content .dv-leg { font-size: 13.5px; }
#content .lg-heat td, #content .lg-heat th { font-size: 14px; }
@media (max-width: 640px) { #content .dv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } #content .dv-fbar { position: static; } }
@media (max-width: 768px) {
    .du-kpi { min-height: 76px; }
    .du-kpi .l { font-size: 11.5px; margin-right: 36px; }
    .du-seg { display: flex; width: 100%; }
    .du-seg button { flex: 1 1 0; justify-content: center; padding: 8px 8px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.2; }
    .du-filters > .du-btn, .du-filters > .du-menu { flex: 1 1 auto; }
    .du-filters > .du-menu > summary { width: 100%; }
    .du-menu .pop { left: 0; right: auto; }
}

/* overflow: clip keeps the rounded-corner clipping without making the card a scroll container, so sticky table headers pin to the page */
#content .card { overflow: clip; }

/* ---------- follow-up modal + legacy ib-btn: bigger text and 44px targets ---------- */
.fu-modal { font-size: 15px; border-radius: 20px; }
.fu-modal h2 { font-size: 22px; }
.fu-sum { font-size: 14.5px; line-height: 1.5; }
.fu-lbl { font-size: 13px; }
.fu-inp { font-size: 15px; min-height: 44px; border-radius: 12px; }
.fu-opt { font-size: 15px; min-height: 48px; }
.fu-tag { font-size: 12.5px; }
.fu-foot .ib-btn, #content .ib-btn { min-height: 44px; font-size: 14.5px; padding: 8px 16px; border-radius: 999px; }
.fu-foot .ib-btn.primary { background: var(--du-brand); border-color: var(--du-brand); }
.fu-err { font-size: 14.5px; }

/* grid children must be allowed to shrink so inner tables scroll instead of widening the page (Learning Gaps at 1024) */
.lg-stack, .lg-grid2 { min-width: 0; }
.lg-stack > *, .lg-grid2 > * { min-width: 0; max-width: 100%; }
#content .lg-scroll, #content .lg-heat-wrap { overflow-x: auto; max-width: 100%; }

/* ------------------------------------------------------------
 * In-person results (tiko-dash-inperson.js): topic bars, score bands, match rows
 * ------------------------------------------------------------ */
.ip-sec { margin: 0 0 var(--du-5); }
.ip-sec > h3 { font-size: 18px; font-weight: 800; margin: 0 0 var(--du-1); color: var(--du-ink); }
.ip-hint, .ip-note { margin: 0 0 var(--du-3); font-size: 14px; color: var(--du-ink-2); max-width: 70ch; }
.ip-n { font-size: 13px; font-weight: 500; color: var(--du-ink-2); }
.ip-tw { overflow-x: auto; }
.ip-bars { display: grid; gap: 10px; }
.ip-bar { display: grid; grid-template-columns: minmax(150px, 300px) 1fr 56px 112px; gap: var(--du-3); align-items: center; font-size: 15px; }
.ip-bar .fl { background: #475569; }
.ip-bar.low .fl { background: #C2410C; }
.ip-bar.mid .fl { background: #1D4ED8; }
.ip-bar.ok .fl { background: #0F766E; }
.ip-st { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.ip-st.low { color: #9A3412; } .ip-st.mid { color: #1E40AF; } .ip-st.ok { color: #115E59; }
.ip-strip { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; background: var(--du-soft); border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-3) var(--du-4); margin: 0 0 var(--du-3); font-size: 14px; color: var(--du-ink-2); }
.ip-strip b { color: var(--du-ink); }
.ip-take { background: var(--du-brand-bg); border: 1px solid #E3C9F0; border-radius: var(--du-r); padding: var(--du-4) var(--du-5); margin: 0 0 var(--du-5); }
.ip-take h3 { margin: 0 0 var(--du-2); font-size: 19px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.ip-take h4 { margin: var(--du-3) 0 var(--du-1); font-size: 16px; font-weight: 800; }
.ip-ul { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.5; }
.ip-ul li { margin: 4px 0; }
.ip-plain { margin: var(--du-3) 0 0; font-size: 14px; color: var(--du-ink-2); max-width: 80ch; }
.ip-acts { display: flex; gap: var(--du-2); flex-wrap: wrap; justify-content: center; margin-top: var(--du-3); }
.ip-steps { list-style: none; margin: 0 0 var(--du-3); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--du-2); }
.ip-steps li { display: flex; gap: var(--du-3); align-items: center; background: var(--du-bg); border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-3); font-size: 15px; font-weight: 600; }
.ip-steps b { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--du-brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.ip-why { margin: 0 0 var(--du-3); font-size: 14px; color: var(--du-ink-2); }
.ip-why summary { cursor: pointer; font-weight: 700; color: var(--du-brand); min-height: 32px; }
.ip-why p { margin: var(--du-1) 0 0; max-width: 80ch; }
.ip-card { align-items: flex-start; }
.ip-stat { margin-top: 6px; }
.ip-big { flex: 1 1 320px; flex-direction: column; align-items: stretch; }
.ip-big select { width: 100%; }
.ip-lb { font-size: 14px; font-weight: 800; }
.ip-btns { display: flex; gap: var(--du-2); flex-wrap: wrap; }
.ip-btns .du-btn { min-height: 48px; font-size: 16px; flex: 1 1 160px; }
.ip-bar .t { font-weight: 700; }
.ip-bar .tr { height: 14px; background: var(--du-soft); border: 1px solid var(--du-line); border-radius: 999px; overflow: hidden; display: block; }
.ip-bar .fl { display: block; height: 100%; background: var(--du-brand); border-radius: 999px; }
.ip-bar.low .fl { background: #B45309; }
.ip-bar.ok .fl { background: #15803D; }
.ip-bar .v { font-weight: 800; text-align: right; }
.ip-dist { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: var(--du-2); }
.ip-col { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--du-3) var(--du-2); background: var(--du-bg); border: 1px solid var(--du-line); border-radius: var(--du-r-sm); }
.ip-col.pass { border-color: #15803D; }
.ip-col .n { font-size: 22px; font-weight: 800; }
.ip-col .b { font-size: 13px; color: var(--du-ink-2); font-weight: 600; }
.ip-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--du-2); }
.ip-act .du-btn { white-space: normal; max-width: 100%; height: auto; }
.ip-act .du-status { white-space: normal; border-radius: var(--du-r-sm); max-width: 100%; }
.ip-row { display: flex; flex-wrap: wrap; gap: var(--du-3) var(--du-4); align-items: center; justify-content: space-between; background: var(--du-bg); border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-3) var(--du-4); }
.ip-who { min-width: 200px; flex: 1 1 240px; }
.ip-who .p { font-size: 16px; font-weight: 800; }
.ip-who .s { font-size: 14px; color: var(--du-ink-2); }
.ip-act { display: flex; flex-wrap: wrap; gap: var(--du-2); align-items: center; }
.ip-act select, .ip-pickbox select { min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--du-line); border-radius: var(--du-r-sm); font: inherit; font-size: 15px; background: #fff; max-width: 100%; }
.ip-pickbox { flex-basis: 100%; display: flex; gap: var(--du-2); flex-wrap: wrap; align-items: center; }
.ip-pickbox[hidden] { display: none; }
.ip-sim { font-weight: 500; opacity: .85; font-size: 13px; }
.ip-score { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--du-soft); border: 1px solid var(--du-line); }
.ip-score.ok { color: #14532D; background: #DCFCE7; border-color: #86EFAC; }
.ip-score.low { color: #7C2D12; background: #FFEDD5; border-color: #FDBA74; }
.ip-person { margin: var(--du-4) 0; }
.ip-ph { font-size: 18px; font-weight: 800; margin: 0 0 var(--du-2); display: flex; align-items: center; gap: 8px; }
.ip-pc { background: var(--du-bg); border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-3) var(--du-4); margin: 0 0 var(--du-2); }
.ip-ps { display: flex; flex-wrap: wrap; gap: var(--du-2); align-items: center; margin: var(--du-1) 0; }
.ip-tl { margin: var(--du-1) 0; padding-left: 18px; font-size: 14px; }
@media (max-width: 640px) {
    .ip-bar { grid-template-columns: 1fr 56px; }
    .ip-bar .tr { grid-column: 1 / -1; order: 3; }
    .ip-bar .ip-st { grid-column: 1 / -1; order: 4; }
    .ip-act .du-btn { flex: 1 1 100%; }
}
/* ------------------------------------------------------------
 * In-person v3: drill-down, readability, refresher focus
 * ------------------------------------------------------------ */
.ip h3 { display: flex; align-items: center; gap: 8px; }
.ip-sec { margin: 0 0 var(--du-6); }
.ip-sec > h3 { font-size: 20px; }
.ip-h4 { font-size: 15px; font-weight: 800; margin: var(--du-4) 0 var(--du-2); color: var(--du-ink-2); text-transform: none; }
.ip-sticky { position: sticky; top: 0; z-index: 6; background: var(--du-soft, #F8FAFC); padding: var(--du-2) 0 var(--du-1); margin: 0 0 var(--du-3); border-bottom: 1px solid var(--du-line); }
.ip-sticky .du-filters { margin: 0 0 var(--du-1); padding: var(--du-2) var(--du-3); }
.ip-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0 0 var(--du-2); padding: 0; font-size: 14px; }
.ip-crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--du-ink-2); }
.ip-crumb, .ip-link { background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--du-brand); font-weight: 700; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.ip-crumb:hover, .ip-link:hover { background: var(--du-brand-bg); border-radius: 6px; }
.ip-crumbs [aria-current] { font-weight: 800; color: var(--du-ink); }
.ip-fchips { display: flex; flex-wrap: wrap; gap: var(--du-2); align-items: center; margin: 0 0 var(--du-2); }
.ip-fchip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--du-line); border-radius: 999px; padding: 2px 4px 2px 12px; font-size: 14px; }
.ip-fchip button { border: 0; background: var(--du-soft, #F8FAFC); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; color: var(--du-ink-2); display: inline-flex; align-items: center; justify-content: center; }
.ip-click { background: #fff; border: 1px solid var(--du-line); border-radius: var(--du-r-sm); padding: 10px 12px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ip-click:hover, .ip-click:focus-visible { border-color: var(--du-brand); background: var(--du-brand-bg); }
.ip-bar.ip-click { grid-template-columns: minmax(150px, 300px) 1fr 56px 112px 18px; }
.ip-go { color: var(--du-ink-2); }
.ip-bars { gap: 8px; }
.ip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--du-3); }
.ip-card2 { position: relative; display: grid; gap: 6px; background: #fff; border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-4); box-shadow: var(--du-shadow); }
button.ip-card2 { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ip-card2 .ip-go { position: absolute; right: 14px; top: 16px; }
.ip-ct { font-size: 17px; font-weight: 800; padding-right: 22px; }
.ip-cbar { height: 12px; background: var(--du-soft); border: 1px solid var(--du-line); border-radius: 999px; overflow: hidden; display: block; }
.ip-cbar .fl { display: block; height: 100%; background: #475569; border-radius: 999px; }
.ip-cbar .fl.low { background: #C2410C; } .ip-cbar .fl.mid { background: #1D4ED8; } .ip-cbar .fl.ok { background: #0F766E; }
.ip-cm { font-size: 14px; color: var(--du-ink-2); }
.ip-more { margin: var(--du-3) 0; }
.ip-more > summary { cursor: pointer; font-weight: 700; color: var(--du-brand); min-height: 36px; display: flex; align-items: center; }
.ip-spark { color: var(--du-brand); display: flex; flex-wrap: wrap; gap: var(--du-3); align-items: center; }
.ip-spark svg { width: 240px; max-width: 100%; height: 56px; background: #fff; border: 1px solid var(--du-line); border-radius: var(--du-r-sm); }
.ip-sp-t { color: var(--du-ink); font-size: 15px; }
.ip-cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--du-3); }
.ip-cmp > div { background: #fff; border: 1px solid var(--du-line); border-radius: var(--du-r); padding: var(--du-3) var(--du-4); display: flex; flex-direction: column; }
.ip-cmp b { font-size: 28px; } .ip-cmp b.neg { color: #9A3412; } .ip-cmp b.pos { color: #115E59; }
.ip-take { margin-top: 0; }
.ip-take .ip-link { text-decoration: none; font-weight: 600; color: var(--du-ink); font-size: 16px; }
.ip-take .ip-link i { color: var(--du-brand); }
.ip-left { justify-content: flex-start; align-items: center; margin: 0 0 var(--du-4); }
.ip-topic { background: #fff; border: 1px solid var(--du-line); border-left: 6px solid #475569; border-radius: var(--du-r); padding: var(--du-4) var(--du-5); margin: 0 0 var(--du-4); box-shadow: var(--du-shadow); }
.ip-topic.low { border-left-color: #C2410C; } .ip-topic.mid { border-left-color: #1D4ED8; } .ip-topic.ok { border-left-color: #0F766E; }
.ip-topic header { display: flex; gap: var(--du-3); align-items: flex-start; }
.ip-rank { flex: 0 0 36px; height: 36px; border-radius: 50%; background: var(--du-brand); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.ip-tt h4 { margin: 0 0 2px; font-size: 19px; font-weight: 800; }
.ip-facts { margin: var(--du-2) 0; font-size: 15px; color: var(--du-ink-2); }
.ip-facts b { color: var(--du-ink); }
.ip-focus { margin: var(--du-2) 0; font-size: 17px; font-weight: 700; display: flex; gap: 8px; }
.ip-wq ul { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ip-ref { margin: var(--du-2) 0; font-size: 15px; }
.ip-agenda { margin: 0; padding-left: 22px; display: grid; gap: var(--du-2); }
.ip-agenda li span { display: block; color: var(--du-ink-2); font-size: 15px; }
.ip-people { background: var(--du-soft); border: 1px solid var(--du-line); border-radius: var(--du-r-sm); padding: var(--du-3) var(--du-4); margin: var(--du-3) 0; }
.ip-people label { display: flex; gap: 8px; align-items: baseline; }
.ip-prio { margin: 0; padding-left: 22px; display: grid; gap: var(--du-2); }
.ip-prio li .ip-n { display: block; font-size: 14px; }
@media (max-width: 640px) {
    .ip-bar.ip-click { grid-template-columns: 1fr 56px 18px; }
    .ip-bar.ip-click .tr { grid-column: 1 / -1; order: 3; }
    .ip-bar.ip-click .ip-st { grid-column: 1 / -1; order: 4; }
    .ip-topic { padding: var(--du-3); }
    .ip-sticky { top: 0; }
    .ip-sec > h3 { font-size: 18px; }
}
@media (max-width: 640px) {
    .ip-sticky { position: static; }
    .ip-ff { display: grid; grid-template-columns: 1fr 1fr; }
    .ip-ff .du-field:first-child:nth-last-child(3) { grid-column: 1 / -1; }
}