/* I-Co demo's — gedeelde stijl. Donkere navy + groen accent, gemaakt voor iPad (landscape). */
:root {
  --bg: #0D1117;
  --surface: #131A23;
  --surface-2: #1A232F;
  --surface-3: #222D3B;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #E8EAF0;
  --muted: #8E99AB;
  --green: #1D9E75;
  --green-bright: #2BC795;
  --green-soft: rgba(29, 158, 117, 0.16);
  --amber: #E5A93D;
  --amber-soft: rgba(229, 169, 61, 0.16);
  --red: #EA6A57;
  --red-soft: rgba(234, 106, 87, 0.16);
  --blue: #6AA6EC;
  --blue-soft: rgba(106, 166, 236, 0.16);
  --gray-soft: rgba(142, 153, 171, 0.16);
  --radius: 14px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(29, 158, 117, 0.35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(29, 158, 117, 0.3); border-radius: 4px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  gap: 4px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; padding: 6px 8px 4px; }
.logo img { height: var(--h, 30px); width: auto; display: block; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.5px; color: #fff; }
.brand-title { padding: 2px 8px 16px; color: var(--muted); font-size: 13px; font-weight: 600; }
.nav-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; padding: 0 12px;
  background: transparent; border: 0; border-radius: 11px;
  color: var(--muted); text-align: left; font-weight: 600; font-size: 15px;
  position: relative;
}
.nav-btn svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--green-soft); color: var(--green-bright); }
.nav-btn.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--green-bright); }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text); }
.nav-count.alert { background: var(--red-soft); color: var(--red); }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.demo-note { font-size: 12px; color: var(--muted); padding: 0 6px 4px; }

.main { overflow-y: auto; padding: 26px 32px 60px; -webkit-overflow-scrolling: touch; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.4px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  font-weight: 650; font-size: 15px; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #22b387; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(234, 106, 87, 0.4); background: transparent; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Cards, KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 14px; font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .kpis.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .value { font-size: 34px; font-weight: 750; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpi.warn .value { color: var(--amber); }
.kpi.bad .value { color: var(--red); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }

/* ---------- Toolbar & chips ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search {
  flex: 1 1 220px; max-width: 340px; min-height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px; outline: none;
}
.search:focus { border-color: var(--green); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  font-weight: 600; font-size: 14px;
}
.chip.active { background: var(--green-soft); border-color: var(--green); color: var(--green-bright); }
.spacer { flex: 1; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
td .sub { color: var(--muted); font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--gray-soft); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green-bright); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: var(--gray-soft); color: var(--muted); }
.badge.plain::before { display: none; }
.label-pill { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 800; font-size: 14px; color: #08140f; }

/* ---------- Attention list / bars ---------- */
.attn { display: grid; gap: 4px; }
.attn-item { display: flex; gap: 12px; align-items: center; padding: 11px 10px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; min-height: 52px; }
.attn-item:hover { background: var(--surface-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.blue { background: var(--blue); } .dot.green { background: var(--green-bright); }
.attn-item .t { font-weight: 600; }
.attn-item .s { color: var(--muted); font-size: 13px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 28px; gap: 10px; align-items: center; margin: 10px 0; font-size: 14px; }
.bar-track { height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-bright)); border-radius: 6px; }

/* ---------- Drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4, 7, 11, 0.62); z-index: 50; display: flex; backdrop-filter: blur(3px); animation: fade 0.16s ease; }
.overlay.right { justify-content: flex-end; }
.overlay.center { align-items: center; justify-content: center; padding: 20px; }
.drawer { width: min(520px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--line-strong); overflow-y: auto; animation: slide 0.2s ease; display: flex; flex-direction: column; }
.drawer-head { padding: 22px 24px 14px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; position: sticky; top: 0; background: var(--surface); z-index: 2; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.3px; }
.drawer-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.drawer-body { padding: 18px 24px 30px; display: grid; gap: 18px; }
.drawer-foot { margin-top: auto; padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; position: sticky; bottom: 0; background: var(--surface); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; font-weight: 600; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.box.ask { border-color: rgba(229, 169, 61, 0.5); background: var(--amber-soft); }
.box.ok { border-color: rgba(29, 158, 117, 0.5); background: var(--green-soft); }
.box.bad { border-color: rgba(234, 106, 87, 0.5); background: var(--red-soft); }
.link-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; text-align: left; min-height: 46px; }
.link-row:hover { background: var(--surface-3); }

/* ---------- Modal / form ---------- */
.modal { width: min(640px, 100%); max-height: 100%; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; animation: pop 0.18s ease; }
.modal.small { width: min(430px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-body { padding: 8px 22px 18px; color: var(--muted); }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 22px 20px; }
.modal-foot > div { display: flex; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 8px 22px 6px; }
.fld { display: grid; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.fld.wide { grid-column: 1 / -1; }
.fld input:not([type=checkbox]), .fld select, .fld textarea {
  min-height: 46px; padding: 8px 12px; background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); outline: none; width: 100%; font-weight: 500;
}
.fld textarea { min-height: 88px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--green); }
.fld.invalid input, .fld.invalid select { border-color: var(--red); }
.fld.check { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.fld.check input { width: 22px; height: 22px; accent-color: var(--green); }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--surface-3); border: 1px solid var(--line-strong); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: pop 0.2s ease; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Smaller screens (iPad portrait, phones) ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .side { flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 6px; }
  .brand { padding: 0 6px 0 2px; } .brand-title, .demo-note, .lbl { display: none; }
  .nav-btn { width: auto; white-space: nowrap; padding: 0 10px; gap: 8px; } .nav-btn.active::before { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; flex: none; }
  .side-foot .btn { min-width: 44px; padding: 0 12px; }
  .main { padding: 20px 18px 50px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
