/* Inzicht, Rapportages and the kiosk wallboard (app/telephony/analytics).
 * Tokens only (tokens.css): works in every preset. The kiosk follows concept
 * B "Command Center": strict grid, monospace numerals, uppercase labels,
 * status rails and threshold colours. */

/* ------------------------------------------------------------- Inzicht */
.in-nav { gap: 6px; flex-wrap: nowrap; }
.in-nav .icon-btn { width: var(--control-h-sm); height: var(--control-h-sm); }
.in-nav .icon-btn .icon { width: 14px; height: 14px; }
.in-hero { padding: calc(var(--pad) * 1.2) var(--pad) var(--pad); border-radius: var(--radius-xl); border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--card-bg);
  box-shadow: var(--card-edge), var(--shadow); }
.in-hero .eyebrow { display: flex; align-items: center; gap: 6px; }
.in-hero .eyebrow .icon { color: var(--accent-text); }
.in-lede { margin: 12px 0 0; max-width: 62ch; font-size: calc(var(--t-xl) * 1.08); line-height: 1.38; letter-spacing: -.022em;
  font-weight: 400; color: var(--text); text-wrap: pretty; }
.in-hero .notice { margin-top: 14px; }
.in-kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.in-kpis .kpi { cursor: help; }
.in-kpis .value { font-size: calc(var(--t-kpi) * .92); }
.delta { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--pill); font-size: var(--t-xs);
  font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.delta.d-ok { background: var(--ok-soft); color: var(--ok); }
.delta.d-danger { background: var(--danger-soft); color: var(--danger); }
.delta.d-up { background: var(--warn-soft); color: var(--warn); }
.delta.d-down { background: var(--ok-soft); color: var(--ok); }
.in-sublabel { font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin: 2px 0 10px; }
.in-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.legend .l-aht { color: var(--accent); }
.legend .l-asa { color: var(--violet); }

/* charts */
.in-chart-box { position: relative; height: 180px; }
.in-chart-box.sm { height: 130px; }
.in-chart-box svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.in-chart .grid-line { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bucket-hit { fill: transparent; }
.bucket.is-link { cursor: pointer; outline: none; }
.bucket.is-link:hover .bucket-hit, .bucket.is-link:focus-visible .bucket-hit { fill: var(--surface-2); }
.bucket.is-link:focus-visible .bucket-hit { stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bar-offered { fill: var(--accent); opacity: .9; }
.bar-answered { fill: var(--text); opacity: .72; }
.bar-missed { fill: var(--danger); }
.trend-sla, .trend-aht, .trend-asa { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.trend-sla { stroke: var(--ok); }
.trend-aht { stroke: var(--accent); }
.trend-asa { stroke: var(--violet); stroke-dasharray: 4 4; }
.dot-sla { fill: var(--ok); }
.dot-aht { fill: var(--accent); }
.dot-asa { fill: var(--violet); }
.goal-line { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }

/* heatmap */
.heat-wrap { display: grid; gap: 10px; overflow-x: auto; }
.heat { display: grid; grid-template-columns: 30px repeat(var(--cols, 12), minmax(18px, 1fr)); gap: 3px; min-width: 360px; }
.heat-hour, .heat-day { font-family: var(--mono); font-size: var(--t-2xs); color: var(--muted); display: grid; place-items: center; }
.heat-day { justify-content: start; text-transform: uppercase; }
.heat-cell { border: 0; padding: 0; height: 24px; border-radius: 5px; background: var(--surface-2); cursor: pointer; }
.heat-cell:disabled { cursor: default; }
.heat-cell:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--text); }
.heat-cell:focus-visible { outline: none; box-shadow: var(--focus); }
.heat-cell.h1 { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.heat-cell.h2 { background: color-mix(in srgb, var(--accent) 34%, var(--surface-2)); }
.heat-cell.h3 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.heat-cell.h4 { background: color-mix(in srgb, var(--accent) 78%, var(--surface-2)); }
.heat-cell.h5 { background: var(--accent); box-shadow: 0 0 12px -2px color-mix(in srgb, var(--accent) 60%, transparent); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: var(--t-2xs); color: var(--muted); }
.heat-legend .heat-cell { width: 18px; height: 12px; cursor: default; display: inline-block; }
.heat-legend span { margin: 0 4px; }

/* horizontal bars, topics, chips, funnel */
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(60px, 2fr) 48px; gap: 12px; align-items: center;
  padding: 6px 8px; border-radius: var(--radius-sm); }
.hbar.is-link { cursor: pointer; }
.hbar.is-link:hover, .hbar.is-link:focus-visible { background: var(--surface-2); outline: none; }
.hbar-l { min-width: 0; }
.hbar-name { display: block; font-weight: 600; font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-l small { display: block; color: var(--muted); font-size: var(--t-2xs); }
.hbar-track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.hbar-track > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); }
.hbar.ok .hbar-track > span { background: var(--ok); }
.hbar.warn .hbar-track > span { background: var(--warn); }
.hbar.danger .hbar-track > span { background: var(--danger); }
.hbar-v { text-align: right; font-weight: 600; font-size: var(--t-sm); }
.in-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: topic; }
.in-topics li { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px 44px; gap: 10px; align-items: center; padding: 6px 4px;
  border-bottom: 1px solid var(--border); font-size: var(--t-sm); }
.in-topics li:last-child { border-bottom: 0; }
.in-topics .delta { justify-self: end; }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; overflow: hidden; text-overflow: ellipsis; }
.linklike:hover { color: var(--accent-text); text-decoration-color: currentColor; }
.in-movers { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.in-movers .in-sublabel { flex-basis: 100%; margin: 0; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--pill); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: var(--t-xs); font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.up { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); }
.in-chips { gap: 6px; }
.funnel { display: grid; gap: 8px; }
.funnel-step { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(80px, 2fr) 56px; gap: 12px; align-items: center;
  padding: 6px 8px; border-radius: var(--radius-sm); }
.funnel-step.is-link { cursor: pointer; }
.funnel-step.is-link:hover, .funnel-step.is-link:focus-visible { background: var(--surface-2); outline: none; }
.funnel-l { font-size: var(--t-sm); font-weight: 600; }
.funnel-l small { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-2xs); }
.funnel-bar { height: 22px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.funnel-bar > span { display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), color-mix(in srgb, var(--ok) 70%, transparent)); }
.funnel-step b { text-align: right; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.th-sort[aria-pressed="true"] { color: var(--accent-text); }
.in-gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.in-gaps li { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: var(--t-sm); }
.in-gaps li:last-child { border-bottom: 0; }

/* forecast */
.in-forecast { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap-sm); }
.fc-day { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.fc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-transform: capitalize; }
.fc-hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(14px, 1fr); gap: 3px; align-items: end; }
.fc-h { display: grid; gap: 3px; justify-items: center; }
.fc-bar { width: 100%; height: 64px; display: flex; align-items: flex-end; background: var(--surface-inset); border-radius: 4px; overflow: hidden; }
.fc-bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.fc-n { font-size: var(--t-xs); font-weight: 700; font-family: var(--mono); }
.fc-l { font-size: var(--t-2xs); color: var(--muted); font-family: var(--mono); }

/* drill-down bar on Gesprekken, kiosk link output */
.drill-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--accent-line); background: var(--accent-soft); font-size: var(--t-sm); color: var(--text-2); }
.drill-bar b { color: var(--text); }
.kiosk-url { flex-wrap: nowrap; }
.kiosk-url input { flex: 1; min-width: 0; }

@media (max-width: 860px) {
  .in-two { grid-template-columns: minmax(0, 1fr); }
  .in-lede { font-size: var(--t-lg); }
  .in-topics li { grid-template-columns: minmax(0, 1fr) 36px 44px; }
  .in-topics li small { display: none; }
}

/* ------------------------------------------------------- kiosk (concept B) */
.shell.kiosk-mode { grid-template-columns: minmax(0, 1fr); }
.shell.kiosk-mode .sidebar, .shell.kiosk-mode .topbar { display: none; }
.shell.kiosk-mode .content { max-width: none; padding: 14px 18px 18px; }
.kiosk-tools { justify-content: flex-end; }
.shell.kiosk-mode .kiosk { min-height: calc(100vh - 92px); }
:fullscreen .kiosk-tools { display: none; }
body.kiosk-page { min-height: 100vh; }
body.kiosk-page .kiosk-host { min-height: 100vh; padding: 14px 18px 18px; display: grid; }
.k-message { min-height: 80vh; display: grid; place-content: center; gap: 8px; text-align: center; }
.k-message h1 { font-size: var(--t-xl); margin: 12px 0 0; color: var(--text); }

.kiosk { --k-line: var(--border); display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; min-height: calc(100vh - 32px);
  font-family: var(--font); color: var(--text); }
.kiosk .num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.k-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border: 1px solid var(--k-line); border-radius: 10px;
  background: var(--surface-solid); font-family: var(--mono); font-size: calc(var(--t-sm) * 1.1); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-2); }
.k-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.k-brand .brand-mark { width: 26px; height: 26px; border-radius: 8px; }
.k-brand .brand-mark .icon { width: 15px; height: 15px; }
.k-sep { color: var(--muted); }
.k-org, .k-scope { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-live { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.k-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.k-live.on { color: var(--ok); }
.k-live.on i { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1.8s ease-out infinite; }
.k-live.wait { color: var(--warn); }
.k-live.wait i { background: var(--warn); }
.k-clock { font-size: calc(var(--t-xl) * 1.05); color: var(--text); letter-spacing: .04em; }

.k-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.k-tile { position: relative; padding: 16px 18px 14px; border: 1px solid var(--k-line); border-radius: 10px; background: var(--surface-solid);
  overflow: hidden; }
.k-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k-tone, var(--muted)); }
.k-tile.t-ok { --k-tone: var(--ok); }
.k-tile.t-warn { --k-tone: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--k-line)); }
.k-tile.t-danger { --k-tone: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--k-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 12%, var(--surface-solid)), var(--surface-solid)); }
.k-label { font-family: var(--mono); font-size: calc(var(--t-xs) * 1.15); letter-spacing: .16em; color: var(--text-2); }
.k-big { font-size: clamp(44px, 5.4vw, 104px); font-weight: 600; line-height: 1.02; margin: 8px 0 6px; color: var(--text); }
.k-big small { font-size: .45em; color: var(--muted); font-weight: 500; }
.k-tile.t-warn .k-big { color: color-mix(in srgb, var(--warn) 85%, var(--text)); }
.k-tile.t-danger .k-big { color: var(--danger); }
.k-tile.t-ok .k-big { color: var(--text); }
.k-sub { font-family: var(--mono); font-size: calc(var(--t-xs) * 1.1); letter-spacing: .06em; color: var(--muted); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.k-panel { display: grid; grid-template-rows: auto 1fr; gap: 12px; padding: 16px 18px; border: 1px solid var(--k-line); border-radius: 10px;
  background: var(--surface-solid); min-height: 0; }
.k-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-title { margin: 0; font-family: var(--mono); font-size: calc(var(--t-sm) * 1.2); letter-spacing: .18em; text-transform: uppercase; color: var(--text-2);
  font-weight: 600; }
.k-dots { display: flex; gap: 8px; }
.k-dots button { width: 34px; height: 6px; border-radius: 3px; border: 0; padding: 0; background: var(--surface-3); cursor: pointer; }
.k-dots button[aria-selected="true"] { background: var(--accent); }
.k-body { min-height: 0; }

.k-queues { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
.k-queue { display: grid; gap: 16px; padding: 20px 22px; border: 1px solid var(--k-line); border-left: 4px solid var(--k-tone, var(--ok));
  border-radius: 8px; background: var(--surface-2); }
.k-queue.t-ok { --k-tone: var(--ok); }
.k-queue.t-warn { --k-tone: var(--warn); }
.k-queue.t-danger { --k-tone: var(--danger); }
.k-queue.t-muted { --k-tone: var(--muted); }
.k-qname { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: clamp(22px, 1.9vw, 40px); font-weight: 600; }
.k-qsl { font-size: clamp(28px, 2.6vw, 56px); }
.k-qstats { display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--mono); font-size: calc(var(--t-sm) * 1.1); letter-spacing: .1em; color: var(--muted); }
.k-qstats b { color: var(--text); font-size: clamp(20px, 1.7vw, 36px); margin-left: 4px; letter-spacing: 0; }
.k-queue.t-warn .k-qstats span:nth-child(-n+2) b, .k-queue.t-danger .k-qstats span:nth-child(-n+2) b { color: var(--k-tone); }
.k-rail { height: 10px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.k-rail > span { display: block; height: 100%; background: var(--ok); }
.k-rail.warn > span { background: var(--warn); }
.k-rail.danger > span { background: var(--danger); }
.k-rail.muted > span { background: var(--muted); }

.k-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--mono); font-size: calc(var(--t-xs) * 1.15); letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-2); }
.k-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; background: var(--state); vertical-align: -1px; }
.k-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.k-agent { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--k-line); border-top: 4px solid var(--state, var(--muted));
  border-radius: 8px; background: var(--surface-2); }
.k-agent.s-offline { opacity: .55; }
.k-astate { font-family: var(--mono); font-size: calc(var(--t-xs) * 1.1); letter-spacing: .14em; color: var(--state, var(--muted)); font-weight: 700; }
.k-aname { font-size: calc(var(--t-lg) * 1.15); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-atime { font-size: clamp(30px, 2.6vw, 52px); font-weight: 600; line-height: 1; color: var(--text); }
.k-agent.s-ringing .k-atime { color: var(--warn); }

.k-today { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(240px, 1fr); gap: 18px; align-items: stretch; }
.k-chart { display: grid; grid-template-rows: 1fr auto; min-height: 240px; }
.k-chart svg { width: 100%; height: 100%; min-height: 220px; }
.k-chart .axis { font-size: calc(var(--t-xs) * 1.1); }
.k-axis { display: grid; grid-template-columns: repeat(var(--cols, 12), minmax(0, 1fr)); justify-items: center; }
.k-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.k-totals div { padding: 12px 14px; border: 1px solid var(--k-line); border-radius: 8px; background: var(--surface-2); }
.k-totals dt { font-family: var(--mono); font-size: calc(var(--t-xs) * 1.05); letter-spacing: .14em; color: var(--muted); }
.k-totals dd { margin: 6px 0 0; font-size: calc(var(--t-xl) * 1.3); font-weight: 600; }
.k-totals .t-danger dd { color: var(--danger); }

.k-foot { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: var(--t-xs); color: var(--muted); letter-spacing: .08em; }
.k-progress { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.k-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.k-btn { height: 28px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--k-line); background: var(--surface-2); color: var(--text-2);
  font: inherit; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.k-btn[aria-pressed="true"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

@media (max-width: 1200px) {
  .k-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .k-today { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .k-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-queues { grid-template-columns: minmax(0, 1fr); }
  .k-bar { flex-wrap: wrap; letter-spacing: .06em; }
}
@media (prefers-reduced-motion: reduce) {
  .k-progress i { transition: none; }
}
