/* Investeringsaanvragen – breedbeeld-layout in Somtoday-stijl. Kleuren via --primair en --accent (Beheer > Instellingen). */
:root {
  --primair: #0b3d7a; --accent: #f6a800;
  --bg: #e8ebf0; --paneel: #fff; --rand: #d5dae2; --rand2: #e7eaef; --tekst: #1f2937; --muted: #6b7280;
  --kop: #f2f4f7; --link: #1f63b8; --groen: #16a34a; --rood: #dc2626; --oranje: #d97706; --blauw: #2563eb;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 13px; color: var(--tekst); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; margin: 0 0 .6em; }
h2 { font-size: 17px; } h3 { font-size: 14px; }
.muted { color: var(--muted); } .klein { font-size: 12px; } .nowrap { white-space: nowrap; }
.waarsch { color: var(--oranje); font-style: italic; }

/* Topbar */
.topbar { background: var(--primair); color: #fff; display: flex; align-items: stretch; height: 46px; padding: 0 0 0 12px; position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding-right: 18px; }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; width: auto; background: #fff; border-radius: 3px; padding: 2px 4px; }
.brand-org { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-app { font-size: 13px; opacity: .85; border-left: 1px solid rgba(255,255,255,.35); padding-left: 10px; }
.mainnav { display: flex; align-items: stretch; }
.mainnav > a, .dropdown > a { color: #fff; display: flex; align-items: center; padding: 0 14px; font-size: 14px; }
.mainnav > a:hover, .dropdown:hover > a { background: rgba(255,255,255,.12); text-decoration: none; }
.mainnav > a.actief, .dropdown.actief > a { background: rgba(255,255,255,.2); }
.dropdown { position: relative; display: flex; }
.dropdown .menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 240px; box-shadow: 0 6px 20px rgba(0,0,0,.18); border-radius: 0 0 4px 4px; padding: 4px 0; }
.dropdown:hover .menu, .dropdown:focus-within .menu { display: block; }
.dropdown .menu a { display: block; color: var(--tekst); padding: 8px 14px; }
.dropdown .menu a:hover { background: var(--kop); text-decoration: none; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.jaarkeuze label { font-size: 12px; opacity: .9; display: flex; gap: 6px; align-items: center; }
.jaarkeuze select { font: inherit; padding: 3px 6px; border-radius: 3px; border: 0; }
.who { display: flex; flex-direction: column; line-height: 1.15; text-align: right; font-size: 12px; }
.who span { opacity: .8; font-size: 11px; }
.iconbtn { color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; width: 46px; align-self: stretch; background: rgba(255,255,255,.1); }
.iconbtn:hover { background: rgba(255,255,255,.22); text-decoration: none; }

/* Tabbar */
.tabbar { display: flex; align-items: flex-end; gap: 4px; padding: 10px 12px 0; border-bottom: 3px solid var(--accent); background: var(--bg); }
.tab { background: var(--accent); color: #1b1b1b; padding: 7px 16px; font-size: 15px; border-radius: 4px 4px 0 0; font-weight: 500; }
.subtab { padding: 7px 12px; color: var(--link); font-size: 13px; border-radius: 4px 4px 0 0; }
.subtab.actief { background: #fff; font-weight: 600; }

.page { flex: 1; padding: 12px; }
.foot { text-align: center; color: var(--muted); font-size: 11px; padding: 8px; }

/* Flash & toast */
.flash { padding: 9px 12px; border-radius: 4px; margin-bottom: 10px; border: 1px solid; }
.flash-ok { background: #ecfdf3; border-color: #a7e3bd; color: #14532d; }
.flash-fout { background: #fef2f2; border-color: #f5b5b5; color: #7f1d1d; }
.flash-info { background: #eff6ff; border-color: #bcd3f5; color: #1e3a8a; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(80px); background: #1f2937; color: #fff; padding: 9px 16px; border-radius: 6px; transition: transform .2s; z-index: 99; }
#toast.toon { transform: translateX(-50%) translateY(0); }
#toast.fout { background: var(--rood); }

/* Knoppen & formulieren */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--primair); color: #fff; border: 1px solid transparent; border-radius: 4px; padding: 6px 12px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn-licht { background: #fff; color: var(--tekst); border-color: var(--rand); }
.btn-rood { background: var(--rood); }
.btn-groen { background: var(--groen); }
.btn-klein { padding: 3px 8px; font-size: 12px; }
.btn-zoek { background: transparent; color: var(--link); font-size: 16px; padding: 2px 6px; }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  font: inherit; border: 1px solid var(--rand); border-radius: 3px; padding: 4px 6px; background: #fff; color: var(--tekst); }
textarea { width: 100%; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primair) 35%, transparent); border-color: var(--primair); }
.inl { display: inline-flex; align-items: center; gap: 5px; }
.kort { width: 70px; }

.form { background: var(--paneel); border: 1px solid var(--rand); border-radius: 4px; padding: 16px; max-width: 980px; }
.form .rij { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; align-items: start; margin-bottom: 10px; }
.form .rij > label { padding-top: 5px; font-weight: 600; }
.form .rij input[type=text], .form .rij input[type=email], .form .rij select { width: 100%; max-width: 480px; }
.form .hulp { color: var(--muted); font-size: 12px; margin-top: 3px; }
.form fieldset { border: 1px solid var(--rand2); border-radius: 4px; margin: 14px 0; padding: 10px 14px; }
.form legend { font-weight: 600; padding: 0 6px; color: var(--primair); }
.knoppen { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* Filterbalk (Somtoday-stijl) */
.filterbar { background: var(--paneel); border: 1px solid var(--rand); border-bottom: 0; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filterbar select { max-width: 160px; font-size: 12px; }
.filterbar .zoek { width: 260px; }
.chips { display: flex; gap: 3px; margin-right: 6px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 3px 9px; border: 1px solid var(--rand); border-radius: 12px; cursor: pointer; font-size: 12px; background: #fff; user-select: none; }
.chip input:checked + span { background: var(--primair); color: #fff; border-color: var(--primair); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }

/* Tegels */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 0; background: var(--paneel); border: 1px solid var(--rand); margin-bottom: 12px; }
.tile { display: flex; flex-direction: column; padding: 10px 14px; border-right: 1px solid var(--rand2); color: var(--tekst); border-top: 3px solid transparent; }
.tile:last-child { border-right: 0; }
.tile:hover { background: var(--kop); text-decoration: none; }
.tile.sel { background: var(--kop); }
.tile .tl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tile .tv { font-size: 21px; font-weight: 600; margin: 2px 0; }
.tile .ts { font-size: 12px; color: var(--muted); }
.t-open { border-top-color: var(--blauw); } .t-goed { border-top-color: var(--groen); } .t-af { border-top-color: var(--rood); }
.t-overig { border-top-color: var(--oranje); } .t-werk { border-top-color: var(--primair); }

/* Layout met zijbalk */
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; align-items: start; }
.zij { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 58px; }
.paneel { background: var(--paneel); border: 1px solid var(--rand); border-radius: 2px; padding: 10px 12px; }
.paneel h3 { font-size: 13px; margin: -10px -12px 8px; padding: 8px 12px; background: var(--kop); border-bottom: 1px solid var(--rand2); }
.paneel > a { display: block; padding: 4px 0; border-bottom: 1px solid var(--rand2); }
.paneel > a:last-child { border-bottom: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 3px; }
.dot.groen { background: var(--groen); } .dot.rood { background: var(--rood); } .dot.oranje { background: var(--oranje); }

/* Tabellen */
.tabelkop { display: flex; align-items: center; gap: 12px; background: var(--paneel); border: 1px solid var(--rand); border-bottom: 0; padding: 7px 10px; flex-wrap: wrap; }
.tabelkop .spacer { flex: 1; }
.bulk[hidden] { display: none; }
.bulk { display: flex; align-items: center; gap: 6px; background: #fff7e0; border: 1px solid var(--accent); padding: 3px 8px; border-radius: 4px; }
.tabelwrap { background: var(--paneel); border: 1px solid var(--rand); overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { background: var(--kop); color: var(--link); font-weight: 600; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rand); font-size: 12px; white-space: nowrap; position: sticky; top: 0; }
.grid td { padding: 6px 8px; border-bottom: 1px solid var(--rand2); vertical-align: top; }
.grid tbody tr:hover td { background: #f7f9fc; }
.grid .num { text-align: right; }
.grid tfoot td { font-weight: 600; background: var(--kop); border-top: 2px solid var(--rand); }
.grid .leeg { text-align: center; color: var(--muted); padding: 20px; }
.grid tr.subtotaal td { background: #f4f6fa; font-weight: 600; font-size: 12px; border-bottom: 2px solid var(--rand); }
.grid tr.st-goedgekeurd td:first-child { box-shadow: inset 3px 0 0 var(--groen); }
.grid tr.st-afgekeurd td:first-child { box-shadow: inset 3px 0 0 var(--rood); }
.grid tr.st-afgekeurd .oms { text-decoration: line-through; color: var(--muted); }
.grid tr.st-overig td:first-child { box-shadow: inset 3px 0 0 var(--oranje); }
.grid tr.flits td { animation: flits .7s; }
@keyframes flits { from { background: #fff3c4; } to { background: transparent; } }
.c-sel, .c-chk { width: 28px; text-align: center; }
.c-oms { min-width: 320px; max-width: 620px; }
.oms { font-weight: 600; }
.mot { color: #4b5563; margin-top: 3px; cursor: pointer; }
.mot.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.opm { margin-top: 3px; font-size: 12px; color: #7c2d12; }
.tag { display: inline-block; font-weight: 400; font-size: 11px; background: var(--kop); border: 1px solid var(--rand2); border-radius: 3px; padding: 0 5px; color: var(--muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); border: 1px solid color-mix(in srgb, var(--c) 40%, #fff); white-space: nowrap; }
.c-status { white-space: nowrap; }
.quick { display: inline-flex; gap: 2px; margin-left: 4px; opacity: .35; transition: opacity .15s; }
tr:hover .quick, .quick:focus-within { opacity: 1; }
.q { border: 1px solid var(--rand); background: #fff; border-radius: 3px; width: 24px; height: 22px; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.q-goed { color: var(--groen); } .q-goed:hover { background: var(--groen); color: #fff; }
.q-af { color: var(--rood); } .q-af:hover { background: var(--rood); color: #fff; }
.q-open { color: var(--blauw); } .q-open:hover { background: var(--blauw); color: #fff; }
.q-sel { width: 30px; padding: 0; height: 22px; font-size: 11px; }
input.uitv[type=text] { width: 92px; font-size: 12px; padding: 2px 4px; }
input.uitv.lev { width: 120px; text-align: left; }
input.uitv.geld { text-align: right; }
input.uitv.bezig { background: #fffbea; }
input.uitv.opgeslagen { background: #e9f9ee; border-color: var(--groen); }
.iconlink { font-size: 15px; padding: 0 4px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini th, .mini td { padding: 4px 4px; border-bottom: 1px solid var(--rand2); text-align: left; }
.mini .num { text-align: right; }
.mini tfoot td { font-weight: 600; border-top: 1px solid var(--rand); }

/* Kaarten (budgethouder) */
.welkom { background: var(--paneel); border: 1px solid var(--rand); padding: 14px 16px; margin-bottom: 12px; }
.welkom h2 { color: var(--primair); }
.melding { font-weight: 600; color: var(--primair); }
.statusregel { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.statusregel.open { background: #e9f9ee; color: #166534; } .statusregel.dicht { background: #fdecec; color: #991b1b; }
.balk { height: 8px; background: var(--rand2); border-radius: 4px; overflow: hidden; display: flex; min-width: 120px; }
.balk span { display: block; height: 100%; }
.log { font-size: 12px; } .log li { margin-bottom: 3px; }

/* Login */
.loginbody { background: var(--primair); align-items: center; justify-content: center; }
.logincard { background: #fff; width: 380px; max-width: calc(100% - 32px); border-radius: 6px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25); margin: auto; }
.loginhead { background: var(--primair); color: #fff; padding: 22px; display: flex; flex-direction: column; gap: 4px; border-bottom: 4px solid var(--accent); }
.loginhead img { height: 44px; align-self: flex-start; background: #fff; padding: 4px 6px; border-radius: 4px; }
.loginhead .brand-app { border: 0; padding: 0; font-size: 16px; }
.loginbody-in { padding: 22px; }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #c7c7c7; width: 100%; justify-content: center; padding: 10px; font-size: 14px; }
.devlogin { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px dashed var(--rand); padding-top: 12px; }
.devlogin input { flex: 1; }

@media (max-width: 1100px) {
  .layout-side { grid-template-columns: 1fr; }
  .zij { position: static; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .brand-app, .who { display: none; }
}
@media print {
  .topbar, .tabbar, .filterbar, .zij, .quick, .c-sel, .tabelkop .btn, .bulk, .foot, #toast { display: none !important; }
  body { background: #fff; font-size: 10px; }
  .layout-side { display: block; }
  .tabelwrap { overflow: visible; border: 0; }
  .grid th { position: static; color: #000; }
  .mot.clamp { -webkit-line-clamp: unset; display: block; }
  input.uitv { border: 0; background: none; width: auto; }
  .tiles { grid-template-columns: repeat(6, 1fr); }
}

.form .rij input.kort { width: 90px; }
