/* Trapwise v3, Control Layer-console. Ontworpen scherm in code, label "Voorbeeld". Tokens uit DESIGN.md. */

:root {
  --green: #22C55E;
  --amber: #F5A524;
}

/* ---------- Sectie ---------- */
.section {
  position: relative;
  padding: 144px var(--gutter);
  background: var(--bg);
}
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.eyebrow {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-glow);
}
h2 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 110;
  max-width: 900px;
}
.section-lead {
  margin: 0 0 56px;
  max-width: 560px;
  font-size: 21px;
  line-height: 1.45;
  color: var(--dim);
}

/* ---------- Console-frame ---------- */
.console {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(104, 213, 234, 0.10), 0 0 0 1px rgba(104, 213, 234, 0.06) inset;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
}
.console.is-live { border-color: rgba(189, 238, 248, 0.35); }
.console * { box-sizing: border-box; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.caps {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Titelbalk */
.console-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a2a33; display: block; }
.console-bar .brand-mini { display: inline-flex; align-items: center; gap: 8px; }
.console-bar .brand-mini img { width: 16px; height: 16px; filter: drop-shadow(0 0 4px rgba(189, 238, 248,.7)); }
.console-bar .title { font-weight: 600; font-size: 13px; }
.console-bar .path { color: var(--dim-2); }
.console-bar .label {
  margin-left: auto;
  color: var(--dim);
}
.console-bar .lbl-short { display: none; }
@media (max-width: 767px) { .console-bar .lbl-short { display: inline; } }
.console-bar .label::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue-glow);
  margin-right: 8px;
  vertical-align: 1px;
  box-shadow: 0 0 8px var(--blue-glow);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Indeling */
.console-body {
  display: grid;
  grid-template-columns: 56px 1fr 340px;
  min-height: 640px;
}
.rail {
  border-right: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
}
.rail button {
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--dim-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.rail button:hover { color: var(--text); background: #1a1a22; }
.rail button.is-active { color: var(--text); border-color: rgba(189, 238, 248,.5); background: rgba(104, 213, 234,.12); }
.rail .rail-sep { width: 20px; height: 1px; background: var(--line); margin: 8px 0; }

.main { padding: 22px 24px; min-width: 0; }
.main-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.main-head .h { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; font-variation-settings: "wdth" 105; }
.main-head .h .dim { color: var(--dim-2); }
.main-head .clock { color: var(--dim); }

/* Statusstrook */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px 14px;
}
.tile .k { color: var(--dim-2); margin-bottom: 8px; }
.tile .v { font-family: var(--font-mono); font-size: 24px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .s { margin-top: 8px; color: var(--dim); font-size: 12px; }
.tile.amber { border-color: rgba(245,165,36,.35); }
.tile.amber .v { color: var(--amber); }
.tile.green .v { color: var(--green); }
.tile .bar { display: flex; gap: 3px; margin-top: 10px; height: 4px; }
.tile .bar i { flex: 1; border-radius: 2px; background: #1d1d26; }
.tile .bar i.on { background: var(--blue); box-shadow: 0 0 6px rgba(104, 213, 234,.6); }

/* Werkstroom */
.stream-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; color: var(--dim-2); }
.stream-head .legend { display: flex; gap: 14px; }
.stream-head .legend span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--dim-2); }
.stream-head .legend .l-run::before { background: var(--blue-glow); }
.stream-head .legend .l-done::before { background: var(--green); }
.stream-head .legend .l-you::before { background: var(--amber); }

.stream {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08080b;
  overflow: hidden;
  height: 372px;
  position: relative;
}
.stream::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(to bottom, rgba(8,8,11,0), #08080b);
  pointer-events: none;
}
.row {
  display: grid;
  grid-template-columns: 58px 132px 1fr 150px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #141419;
  animation: rowin 480ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rowin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.row .t { color: var(--dim-2); }
.row .dept {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.row .what { min-width: 0; }
.row .what .task { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .what .agent { color: var(--dim-2); font-size: 12px; margin-top: 2px; }
.row .what .agent b { color: var(--dim); font-weight: 500; }
.row .st { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.row .st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dim-2); flex: none; }
.row .st.run { color: var(--blue-glow); }
.row .st.run::before { background: var(--blue-glow); box-shadow: 0 0 8px var(--blue-glow); animation: pulse 1.4s ease-in-out infinite; }
.row .st.done { color: var(--green); }
.row .st.done::before { background: var(--green); }
.row .st.you { color: var(--amber); }
.row .st.you::before { background: var(--amber); box-shadow: 0 0 8px rgba(245,165,36,.7); }
.row .st.hold { color: var(--dim); }
.row.is-new { background: rgba(104, 213, 234,.06); }

/* Onderste regel */
.foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; color: var(--dim-2);
}
.foot .agents { display: flex; gap: 14px; flex-wrap: wrap; }
.foot .agents span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; }

/* Besluitkolom */
.aside {
  border-left: 1px solid var(--line);
  padding: 22px 20px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.aside .h { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; font-variation-settings: "wdth" 105; margin: 6px 0 4px; }
.aside .sub { color: var(--dim-2); margin-bottom: 16px; }
.aside .caps.k { color: var(--dim-2); }
.aside .caps.k b { color: var(--amber); font-weight: 500; }
.decisions { display: flex; flex-direction: column; gap: 10px; }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 12px 12px;
  animation: rowin 480ms cubic-bezier(.2,.7,.2,1) both;
}
.card .cd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card .cd .n { font-family: var(--font-mono); font-size: 11px; color: var(--amber); }
.card .cd .dept { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim-2); }
.card .q { font-weight: 600; font-size: 14px; line-height: 1.3; }
.card .why { margin-top: 6px; color: var(--dim); font-size: 12px; line-height: 1.4; }
.card .acts { display: flex; gap: 10px; margin-top: 12px; }
.card .acts button {
  --cut: 7px;
  position: relative;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: filter .2s, transform .2s;
}
.card .acts button > span {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  overflow: hidden;
  transition: background .2s;
}
.card .acts button.ok { filter: drop-shadow(0 0 8px rgba(104, 213, 234, 0.5)); }
.card .acts button.ok > span {
  background:
    linear-gradient(180deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.05) 42%, rgba(0,0,0,0) 50%),
    linear-gradient(180deg, #3FC4E0 0%, #1A93BC 60%, #0B6E93 100%);
  box-shadow:
    inset 0 0.2rem 0.6rem rgba(255,255,255,.26),
    inset 0 -0.08rem 0.2rem rgba(0,0,0,.7),
    inset 0 -0.3rem 0.6rem rgba(189, 238, 248,.55);
}
.card .acts button.ok > span::before {
  content: "";
  position: absolute; left: -15%; right: -15%; top: -100%; bottom: 25%;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  transition: transform .3s ease;
  pointer-events: none;
}
.card .acts button.ok:hover > span::before { transform: translateY(-5%); }
.card .acts button.ok > span::after {
  content: "";
  position: absolute; top: -40%; left: -60%; width: 45%; height: 180%;
  background: linear-gradient(105deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-12deg);
  pointer-events: none;
}
.card .acts button.ok:hover { filter: drop-shadow(0 0 14px rgba(104, 213, 234, 0.75)); transform: translateY(-1px); }
.card .acts button.ok:hover > span { background: linear-gradient(180deg, #4a5aff 0%, #1a1aff 55%, #0000e0 100%); }
.card .acts button.ok:hover > span::after { animation: sweep 600ms cubic-bezier(.2,.7,.2,1) forwards; }
.card .acts button.hold > span {
  background: #101016;
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--dim);
}
.card .acts button.hold:hover > span { box-shadow: 0 0 0 1px var(--dim-2) inset; color: var(--text); }
.card .acts button:active { transform: translateY(1px); }
.card .acts button:focus-visible { outline: 2px solid var(--blue-glow); outline-offset: 3px; }
.card.is-done { border-color: rgba(34,197,94,.4); }
.card.is-done .q::before { content: "✓ "; color: var(--green); }
.card.is-done .acts { display: none; }
.card.is-done .why { color: var(--green); }
.card.is-held { border-color: var(--line, rgba(255,255,255,.12)); }
.card.is-held .q::before { content: none; }
.card.is-held .why { color: var(--dim); }
.aside .log { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim-2); font-size: 12px; line-height: 1.5; }
.aside .log div { display: flex; justify-content: space-between; gap: 10px; }
.aside .log .mono { color: var(--dim-2); }

/* Voorbeeld-label onder de console */
.console-note {
  margin: 14px 0 0;
  color: var(--dim-2);
}

/* ---------- Mobiel ---------- */
@media (max-width: 1023px) {
  .console-body { grid-template-columns: 1fr; }
  .rail { display: none; }
  .aside { border-left: 0; border-top: 1px solid var(--line); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 48px 1fr 118px; }
  .row .dept { display: none; }
}
@media (max-width: 767px) {
  .section { padding: 80px var(--gutter); }
  .section-lead { font-size: 18px; margin-bottom: 32px; }
  .console { border-radius: 12px; font-size: 12px; }
  .console-bar { height: 42px; padding: 0 12px; gap: 10px; flex-wrap: nowrap; }
  .console-bar .path { display: none; }
  .console-bar .title { white-space: nowrap; }
  .console-bar .label { font-size: 10px; white-space: nowrap; }
  .console-bar .lbl-full { display: none; }
  .main { padding: 16px 14px; }
  .main-head .h { font-size: 18px; }
  .tile .v { font-size: 20px; }
  .stream { height: 330px; }
  .row { grid-template-columns: 1fr 96px; padding: 10px 12px; }
  .row .t { display: none; }
  .row .what .task {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
  }
  .stream-head .legend { display: none; }
  .stream { height: 360px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .aside { padding: 18px 14px; }
}
