:root {
  --ipm-brown: #c48a1c;
  --ipm-brown-dark: #8a5f0f;
  --ipm-bg: #f3f4f6;
  --ipm-blue: #3b8ed0;
  --ipm-red: #e2616b;
  --ipm-grey: #9aa0a6;
  --ipm-text: #1f2328;
}
html, body { margin: 0; height: 100%; font-family: "Segoe UI", system-ui, sans-serif; font-size: 13px; color: var(--ipm-text); background: var(--ipm-bg); }
a { color: inherit; text-decoration: none; }
h1 { font-size: 20px; font-weight: 600; margin: 0; color: var(--ipm-blue); }
h2 { font-size: 13px; font-weight: 700; margin: 0 0 6px; color: #2e7d32; }

/* top bar */
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 16px; height: 42px; background: #fff; border-bottom: 1px solid #ddd; }
.topbar .brand { font-size: 17px; font-weight: 700; color: var(--ipm-brown-dark); }
.topbar .brand span { font-weight: 300; }
.topbar .env { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 10px; background: #fde68a; color: #7c4a03; }
.topbar nav a { padding: 4px 8px; border-radius: 4px; }
.topbar nav a:hover { background: #eef2f7; }
.topbar .spacer { flex: 1; }
.topbar .user { color: #555; }
.topbar .logout button { border: 1px solid #ccc; background: #fff; padding: 3px 10px; border-radius: 4px; cursor: pointer; }
main { flex: 1; overflow: auto; padding: 10px 16px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #fdf3dc, #e8eef7); }
.login-card { width: 340px; background: #fff; padding: 28px 32px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.login-card h1 { color: var(--ipm-brown-dark); font-size: 26px; }
.login-card h1 span { font-weight: 300; }
.login-card .sub { margin: 2px 0 18px; color: #777; }
.login-card label { display: block; margin-bottom: 12px; font-weight: 600; color: #444; }
.login-card input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px; border: 1px solid #c9ced6; border-radius: 6px; font: inherit; }
.login-card button { width: 100%; margin-top: 6px; padding: 9px; border: 0; border-radius: 6px; background: var(--ipm-blue); color: #fff; font-weight: 600; cursor: pointer; }
.login-card .error { color: #b00020; }
.login-card .validation-message { color: #b00020; font-weight: 400; font-size: 12px; }

/* project list */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 8px; }
.page-head .count { margin-top: 4px; }
.filters { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 6px 12px; display: grid; gap: 4px; }
.filter-row { display: flex; align-items: center; gap: 10px; }
.filter-row label { min-width: 150px; font-weight: 700; background: #fde9b8; padding: 2px 6px; border-radius: 3px; }
.projects-grid .rz-datatable-data td { padding: 2px 6px !important; }
.projects-grid .rz-grid-table { font-size: 12.5px; }
.projects-grid .money { color: var(--ipm-blue); font-weight: 600; }
.projects-grid .subs { color: #c62828; font-weight: 700; }
.projects-grid tr.row-hoofdproject td { background: #fff59d !important; }
.projects-grid tr.row-deelproject td { background: #f3d9d9 !important; }
.projects-grid tr.row-regie td { background: #c8f0dc !important; }
.projects-grid tr.row-raamcontract td { background: #d9e8ff !important; }
.projects-grid tr:hover td { filter: brightness(.96); cursor: pointer; }

/* ribbon */
.ribbon { display: flex; align-items: stretch; gap: 6px; background: #fff; border: 1px solid #d5d8dc; border-radius: 6px; padding: 6px 8px 2px; margin-bottom: 10px; overflow-x: auto; }
.rb-group { display: flex; flex-direction: column; border-right: 1px solid #e3e5e8; padding-right: 6px; }
.rb-group:last-child { border-right: 0; }
.rb-items { display: flex; gap: 2px; flex: 1; }
.rb-label { text-align: center; font-size: 11px; color: #666; margin-top: 2px; }
.rb-btn { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: 78px; padding: 4px 2px; border-radius: 4px; text-align: center; font-size: 11.5px; line-height: 1.15; }
.rb-btn:hover { background: #eef2f7; }
.rb-btn.active { background: #e3ecf7; outline: 1px solid #b7c9e2; }
.rb-btn .rzi { font-size: 30px; width: 36px; height: 30px; border-radius: 5px; color: #fff; margin-bottom: 4px; display: grid; place-items: center; }
.rb-blue .rzi { background: var(--ipm-blue); }
.rb-red .rzi { background: var(--ipm-red); }
.rb-grey .rzi { background: var(--ipm-grey); }
.rb-current-project { width: 120px; padding: 4px 6px; }
.rb-current-project .nr { font-weight: 700; }
.rb-current-project .nm { font-size: 11.5px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* kaart */
.kaart-head { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 16px; background: #fff; border: 1px solid #d5d8dc; border-radius: 6px; padding: 8px 14px; margin-bottom: 10px; }
.kaart-head .title h1 { color: #2e7d32; }
.kaart-head .klant { color: #777; font-size: 15px; }
.kaart-head .ident { text-align: center; }
.kaart-head .ident .nr { font-size: 20px; font-weight: 700; }
.kaart-head .ident .oms { color: #777; font-size: 15px; }
.kaart-head .archief { margin-left: 10px; color: #c62828; font-size: 14px; }
.kaart-head .actions { display: flex; gap: 6px; }
.kaart { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.kaart section { background: #fff; border: 1px solid #d5d8dc; border-radius: 6px; padding: 10px 14px; }
.fld { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px; margin-bottom: 4px; }
.fld.wide { grid-template-columns: 150px 1fr; }
.fld label { color: #333; }
.fld input.val { padding: 3px 6px; border: 1px solid #c9ced6; border-radius: 3px; background: #fbfbfb; font: inherit; width: 100%; box-sizing: border-box; }
.fld input.val.narrow { width: 90px; }
.fld .val.chk { text-align: left; }
.flags { display: flex; gap: 14px; margin-top: 6px; }
.flags .fld { grid-template-columns: auto auto; }
.fin-table { border-collapse: collapse; width: 100%; }
.fin-table th { text-align: right; font-size: 12px; padding: 2px 6px; }
.fin-table th:first-child { text-align: left; }
.fin-table td { padding: 2px 6px; text-align: right; border-bottom: 1px solid #f0f0f0; }
.fin-table td:first-child { text-align: left; }
.fin-table td:nth-child(2) { color: #2e7d32; }
.fin-table td:nth-child(3) { color: var(--ipm-blue); }
.fin-table tr.total td { font-weight: 700; }
.fin .note { color: #888; font-size: 12px; margin: 8px 0 0; }

/* section stub */
.sectie { background: #fff; border: 1px solid #d5d8dc; border-radius: 6px; padding: 16px 20px; max-width: 760px; }
.sectie .sub { color: #777; margin: 2px 0 14px; }
.sectie .back { display: inline-block; margin-top: 12px; color: var(--ipm-blue); }
.loading { color: #777; }

#blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
