:root { --c: #AE2D5D; --c2: #F9E6EE; --bg: #F6F0EE; --tx: #22141A; --mu: #8B7380; --ln: #EADCE2; --ok: #16A34A; --bl: #1D5FA8; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--tx); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--c); }
svg { flex: none; }
.muted { color: var(--mu); }
small.muted, .small { font-size: 13px; }

/* layout */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.nav { background: #fff; border-right: 1px solid #F0E4E9; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 4px 16px; }
.brand b { display: block; font-size: 15px; } .brand small { color: var(--mu); font-size: 12px; }
.lg { width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-family: Georgia, serif; font-weight: 700; font-size: 11.5px; line-height: 1; text-align: center; flex: none; }
.ni { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 600; color: #4A3540; text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.ni:hover { background: #FAF5F7; } .ni.on { background: var(--c2); color: var(--c); }
.conn { margin-top: auto; border-radius: 14px; padding: 12px; font-size: 12.5px; }
.conn.ok { background: #F2FAF4; border: 1px solid #CBEBD5; color: #166534; }
.conn.no { background: #FFF7E6; border: 1px solid #F6DFAF; color: #92400E; }
.conn b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.who { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--mu); padding: 10px 6px 0; }
.who button { border: 0; background: none; color: var(--c); font-weight: 700; cursor: pointer; }
.main { padding: 24px 28px 60px; min-width: 0; max-width: 1400px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.top h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; } .top p { color: var(--mu); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* knoppen en velden */
.btn { height: 42px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 14px; background: #fff; border: 1px solid var(--ln); color: #4A3540; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: #D9C4CD; } .btn:disabled { opacity: .5; cursor: default; }
.btn.p { background: var(--c); color: #fff; border-color: var(--c); } .btn.g { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lnk { border: 0; background: none; color: var(--c); padding: 0 6px; }
.btn.danger { color: #B42318; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ln); background: #fff; font-size: 13px; color: #6B5560; cursor: pointer; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--c); color: #fff; border-color: var(--c); }
label.f { display: block; font-size: 12.5px; font-weight: 700; color: var(--mu); margin-bottom: 10px; }
label.f > input, label.f > select, label.f > textarea, .in { display: block; width: 100%; margin-top: 4px; height: 42px; border: 1px solid var(--ln); border-radius: 11px; padding: 0 12px; background: #fff; font-size: 15px; font-weight: 500; color: var(--tx); }
label.f > textarea, textarea.in { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--c) 35%, transparent); border-color: var(--c); }
label.f small { display: block; font-weight: 500; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }

/* kaarten */
.card { background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 2px 10px rgba(60, 20, 35, .05); }
.card h3 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.eb { display: inline-flex; align-items: center; gap: 4px; background: #EEF5FD; color: var(--bl); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.own { background: #F1EDEF; color: #6B5560; }

/* AI-blok */
.ai { background: linear-gradient(135deg, #fff, #FDF3F7); border: 1.5px solid #F0C9D8; margin-bottom: 14px; }
.ai h3 { color: var(--c); }
.ai textarea { width: 100%; min-height: 70px; border: 1px solid var(--ln); border-radius: 14px; padding: 12px 14px; font-size: 15px; background: #fff; resize: vertical; }
.ai .row { margin-top: 10px; }
.explain { margin-top: 10px; font-size: 13px; color: #6B5560; background: #fff; border-radius: 12px; padding: 10px 12px; border: 1px dashed #F0C9D8; }
.explain b { color: var(--c); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: sp .8s linear infinite; }
.btn:not(.p) .spin { border-color: #ddd; border-top-color: var(--c); }
@keyframes sp { to { transform: rotate(360deg); } }

/* editor */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
table.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines th { text-align: left; color: var(--mu); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 6px; border-bottom: 1px solid #F0E4E9; }
.lines td { padding: 7px 6px; border-bottom: 1px solid #F7EFF2; vertical-align: middle; }
.lines .r { text-align: right; white-space: nowrap; }
.lines .nm { font-weight: 700; }
.lines .nm-in { width: 100%; min-width: 140px; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; font-weight: 700; background: transparent; resize: none; field-sizing: content; line-height: 1.3; display: block; }
.lines .nm-in:hover { border-color: var(--ln); }
.lines input.note { width: 100%; border: 0; padding: 2px 6px; font-size: 12.5px; color: var(--mu); background: transparent; }
.lines input.q, .lines input.pr { width: 74px; text-align: right; border: 1px solid var(--ln); border-radius: 8px; padding: 5px 7px; font-weight: 700; background: #fff; }
.lines input.pr { width: 88px; }
.lines select.vat { border: 1px solid var(--ln); border-radius: 8px; padding: 4px; background: #fff; font-size: 13px; }
.lines .x { border: 0; background: none; color: #C3AEB8; cursor: pointer; padding: 4px; border-radius: 8px; display: grid; place-items: center; }
.lines .x:hover { color: #B42318; background: #FDECEC; }
.lines tr.flash td { background: #FFFBEA; transition: background 1.5s; }
.empty { text-align: center; color: var(--mu); padding: 30px 10px; }
.sm-row { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.sm-row.t { font-size: 20px; font-weight: 800; border-top: 1px solid #F0E4E9; margin-top: 8px; padding-top: 10px; }
.sm-row.t span:last-child { color: var(--c); }
.cust b { font-size: 16px; display: block; } .cust .muted { font-size: 13px; }
.status { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.s-concept { background: #F1EDEF; color: #6B5560; } .s-sent { background: #EEF5FD; color: var(--bl); } .s-viewed { background: #E0EDFC; color: #174E8C; }
.s-accepted { background: #E7F6EC; color: #166534; } .s-invoiced { background: #F3E8FF; color: #7C3AED; } .s-declined, .s-expired { background: #FDECEC; color: #B42318; }
.banner { border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.banner.ok { background: #E7F6EC; color: #14532D; } .banner.inv { background: #F3E8FF; color: #4C1D95; } .banner.warn { background: #FFF7E6; color: #92400E; } .banner.info { background: #EEF5FD; color: #173F6E; }
.log { font-size: 12.5px; color: var(--mu); display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; }

/* lijst */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stats .card small { color: var(--mu); font-weight: 700; } .stats .card b { display: block; font-size: 26px; letter-spacing: -.01em; }
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.list th { text-align: left; color: var(--mu); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid #F0E4E9; }
.list td { padding: 12px 10px; border-bottom: 1px solid #F7EFF2; }
.list tr.cl { cursor: pointer; } .list tr.cl:hover td { background: #FCF8FA; }
.list .r { text-align: right; }

/* producten */
.search { height: 54px; background: #fff; border: 2px solid var(--c); border-radius: 16px; display: flex; align-items: center; gap: 12px; padding: 0 16px; margin-bottom: 12px; }
.search input { border: 0; outline: 0; flex: 1; font-size: 18px; font-weight: 600; background: none; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pr { background: #fff; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 10px rgba(60,20,35,.05); }
.pr b { font-size: 15.5px; } .pr small { color: var(--mu); font-size: 12.5px; }
.pr .pp { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.pr .pp strong { font-size: 18px; color: var(--c); }
.ic-btn { width: 36px; height: 36px; border-radius: 11px; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--c); color: #fff; }
.ic-btn.ghost { background: #F5EEF1; color: #8B7380; } .ic-btn.ghost.on { color: #E3A008; }
mark { background: #FFF3B0; border-radius: 3px; padding: 0 1px; color: inherit; }

/* dialoog */
dialog { border: 0; border-radius: 24px; padding: 0; width: min(720px, 94vw); max-height: 90vh; box-shadow: 0 30px 80px rgba(0,0,0,.3); margin: auto; }
dialog::backdrop { background: rgba(40, 10, 22, .45); }
.dlg { padding: 22px; display: flex; flex-direction: column; max-height: 90vh; }
.dlg-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dlg-h h2 { font-size: 21px; } .dlg-b { overflow: auto; flex: 1; min-height: 0; }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.xbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: #F5EEF1; cursor: pointer; display: grid; place-items: center; color: #6B5560; }
.plist { display: flex; flex-direction: column; gap: 6px; }
.pli { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #F0E4E9; border-radius: 14px; cursor: pointer; background: #fff; text-align: left; width: 100%; }
.pli:hover { border-color: var(--c); background: #FDF7FA; }
.pli .grow b { display: block; font-size: 14.5px; } .pli small { color: var(--mu); }
.pli strong { color: var(--c); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 600px at 30% 20%, #D24A7D, var(--c) 55%, #6E1838); }
.login .card { width: min(420px, 100%); padding: 28px; }
.login h1 { font-size: 24px; margin: 12px 0 4px; }
.err { color: #B42318; font-size: 14px; margin: 6px 0; min-height: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #22141A; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 99; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 90vw; }
.toast.bad { background: #B42318; }
.set-sec { margin-bottom: 14px; }
.set-sec h3 { font-size: 17px; }
.okline { color: #166534; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.hint { background: #FAF5F7; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #6B5560; margin-bottom: 12px; }
.mob-top { display: none; }

@media (max-width: 1050px) { .ed { grid-template-columns: 1fr; } .side { position: static; } .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px; z-index: 20; border-right: 0; border-top: 1px solid #F0E4E9; justify-content: space-around; }
  .nav .brand, .nav .conn, .nav .who { display: none; }
  .ni { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; width: auto; flex: 1; align-items: center; }
  .main { padding: 16px 14px 90px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .lines .hide-m { display: none; }
  .list .hide-m { display: none; }
  .mob-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
}
@media print { .nav, .top .row { display: none; } }
