/* BOEKUNA calm UX: a still page behind open windows, simpler forms and fewer colours.
   App-only presentation layer, loaded last. */

/* The page behind an open window stays put; only the window scrolls. */
html.modal-scroll-locked,html.modal-scroll-locked body{overscroll-behavior:none}
html.modal-scroll-locked body{position:fixed;left:0;right:0;width:100%;overflow:hidden}
#modalRoot .modal,#modalRoot .modal-body{overscroll-behavior:contain}
/* No pinch-zoom on normal app screens; invoice, document and report previews keep it. */
html:not(.app-zoom-allowed) body{touch-action:pan-x pan-y}

/* Choice chips: one tap instead of a dropdown. */
#modalRoot .choice-group{border:0;margin:0;padding:0;min-width:0}
#modalRoot .choice-group legend{margin-bottom:8px;padding:0;color:#5E6870;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
#modalRoot .choice-chips{display:flex;flex-wrap:wrap;gap:8px}
#modalRoot .choice-chip{position:relative;display:inline-flex;margin:0!important;padding:0!important;text-transform:none!important;letter-spacing:0!important}
#modalRoot .choice-chip input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
#modalRoot .choice-chip span{
  display:inline-flex;align-items:center;min-height:42px;padding:0 15px;
  border:1px solid var(--app-border-strong,#CBD2D7);border-radius:999px;background:#FFFFFF;
  color:#1B1F23;font-size:15px;font-weight:650;cursor:pointer;user-select:none;
}
#modalRoot .choice-chip input:checked+span{border-color:#1B1F23;background:#1B1F23;color:#FFFFFF}
#modalRoot .choice-chip input:focus-visible+span{outline:3px solid var(--app-focus,#2E7D3A);outline-offset:2px}
#modalRoot .expense-more{border:1px solid var(--app-border,#E4E7EA);border-radius:12px;padding:0}
#modalRoot .expense-more>summary{cursor:pointer;padding:13px 14px;font-weight:700}
#modalRoot .expense-more>.form-grid{padding:0 14px 14px}

/* Payment: who paid how, in one glance. */
#modalRoot .payment-intro{margin:0 0 16px;color:#5E6870;font-size:15px}
#modalRoot .payment-intro strong{color:#1B1F23}

/* Invoice menu: status line, main actions, the rest under "Meer". */
#modalRoot .invoice-action-status{margin:0 0 12px;color:#5E6870;font-size:15px}
#modalRoot .action-row{background:#FFFFFF;text-align:left}
#modalRoot .action-row.is-danger strong{color:var(--bad)}
#modalRoot .invoice-action-more{margin-top:10px}
#modalRoot .invoice-action-more>summary{cursor:pointer;padding:12px 4px;color:#5E6870;font-weight:700}
#modalRoot .invoice-action-more>.action-list{margin-top:4px}

/* Expense details as a short list instead of boxed cards. */
#modalRoot .expense-detail-amount{font-size:30px;font-weight:800;letter-spacing:-.02em;margin-bottom:10px}
#modalRoot .expense-detail-list{margin:0;display:grid;gap:0}
#modalRoot .expense-detail-list>div{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-top:1px solid var(--app-border,#E4E7EA)}
#modalRoot .expense-detail-list dt{color:#5E6870}
#modalRoot .expense-detail-list dd{margin:0;text-align:right;font-weight:600}

/* E-mail: one send screen. Address, the mail as the customer reads it, the PDF. */
#modalRoot #emailHandoffForm.email-send-form{display:grid;gap:14px}
#modalRoot .modal:has(#emailHandoffForm):focus{outline:none}
#modalRoot #emailHandoffForm .email-send-letter{display:grid;border:1px solid var(--app-border,#E4E7EA);border-radius:14px;background:#FFFFFF;overflow:hidden}
#modalRoot #emailHandoffForm .email-send-subject{width:100%;min-height:48px;border:0;border-bottom:1px solid var(--app-border,#E4E7EA);border-radius:0;padding:12px 14px;font-weight:700;font-size:15px;background:transparent;color:inherit;outline:none}
#modalRoot #emailHandoffForm .email-send-body{width:100%;border:0;border-radius:0;padding:14px;background:transparent;color:inherit;outline:none;box-shadow:none}
#modalRoot #emailHandoffForm .email-send-letter:focus-within{border-color:#8AA69A}
#modalRoot #emailHandoffForm .email-message{min-height:280px!important;line-height:1.55;font-size:14px;resize:vertical}
#modalRoot .email-send-pdf{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--app-border,#E4E7EA);border-radius:12px;background:#FFFFFF}
#modalRoot .email-send-pdf-icon{flex:0 0 auto;display:grid;place-items:center;width:38px;height:38px;border-radius:9px;background:#FCEBEA;color:#B42318;font-size:10px;font-weight:800;letter-spacing:.04em}
#modalRoot .email-send-pdf:not(.is-ready) .email-send-pdf-icon{opacity:.55}
#modalRoot .email-send-pdf-text{display:grid;gap:2px;min-width:0;flex:1}
#modalRoot .email-send-pdf-text strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#modalRoot .email-send-pdf-text small{font-size:12px;color:#5E6870}
#modalRoot .email-send-pdf.is-ready .email-send-pdf-text small{color:#1E7A3C}
#modalRoot .email-send-pdf.is-error{border-color:#F2C9C5}
#modalRoot .email-send-hint{margin:0;font-size:12px;line-height:1.5}
#modalRoot .email-send-hint .link-btn{font-size:12px;text-decoration:underline}
#toastRoot .toast.has-action{display:flex;align-items:center;gap:14px}
#toastRoot .toast-action{border:0;background:transparent;color:inherit;font:inherit;font-weight:800;text-decoration:underline;padding:4px 0;cursor:pointer;white-space:nowrap}
@media(max-width:820px){
  #modalRoot .modal:has(#emailHandoffForm){height:calc(var(--mobile-viewport-height,100dvh) - max(8px,env(safe-area-inset-top)))!important}
  #modalRoot .modal:has(#emailHandoffForm) .modal-body{flex:1 1 auto}
  #modalRoot #emailHandoffForm .email-message{min-height:max(260px,42dvh)!important;max-height:none!important;height:auto!important;font-size:16px!important}
  #modalRoot #emailHandoffForm .email-send-subject{font-size:16px}
}

/* Company details: what invoices need first, the rest folded away. */
#mainApp .profile-section-essentials{margin-bottom:14px}
#mainApp .profile-more{margin-top:4px;border:1px solid var(--app-border,#E4E7EA);border-radius:14px;background:#FFFFFF}
#mainApp .profile-more>summary{cursor:pointer;padding:15px 16px;font-weight:700}
#mainApp .profile-more[open]>summary{border-bottom:1px solid var(--app-border,#E4E7EA)}
#mainApp .profile-more>*:not(summary){margin:14px}

/* "Nog te doen": what, why, and one clear next step per row. */
#mainApp .dashboard-attention .badge.neutral{background:#F1F3F4!important;color:#3A4148!important;border-color:var(--app-border)!important}
#mainApp .dashboard-attention-list{gap:0!important}
#mainApp .dashboard-attention-item,
#mainApp .dashboard-attention-item:is(.urgent,.review,.soon){
  display:grid!important;grid-template-columns:10px minmax(0,1fr) auto!important;align-items:center;gap:12px!important;
  min-height:0!important;padding:14px 2px!important;
  border:0!important;border-top:1px solid var(--app-border)!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;transform:none!important;
}
#mainApp .dashboard-attention-item:first-child{border-top:0!important}
#mainApp .dashboard-attention-item:hover{background:transparent!important}
#mainApp .dashboard-attention-item .dashboard-attention-icon{
  width:10px!important;height:10px!important;min-width:0!important;padding:0!important;border:0!important;border-radius:50%!important;
  font-size:0!important;background:#C9A227!important;align-self:start;margin-top:6px;
}
#mainApp .dashboard-attention-item.urgent .dashboard-attention-icon{background:var(--status-error)!important}
#mainApp .dashboard-attention-item.soon .dashboard-attention-icon{background:var(--status-info)!important}
#mainApp .dashboard-attention-copy{display:grid;gap:3px}
#mainApp .dashboard-attention-copy strong{color:var(--app-ink)!important;font-size:15px;line-height:1.3}
#mainApp .dashboard-attention-copy span{color:var(--app-muted-strong)!important;font-size:13.5px;font-weight:500;line-height:1.35}
#mainApp .dashboard-attention-cta{
  display:inline-flex;align-items:center;min-height:36px;padding:0 14px;white-space:nowrap;
  border:1px solid var(--app-border-strong);border-radius:999px;background:#FFFFFF;color:var(--app-ink);font-size:14px;font-weight:700;
}
#mainApp .dashboard-attention-item:hover .dashboard-attention-cta{border-color:var(--app-ink)}
@media(max-width:480px){
  #mainApp .dashboard-attention-item,
  #mainApp .dashboard-attention-item:is(.urgent,.review,.soon){grid-template-columns:10px minmax(0,1fr)!important}
  #mainApp .dashboard-attention-cta{grid-column:2;justify-self:start;margin-top:2px}
}

/* Fewer colours: neutral icons and numbers unless something really needs attention. */
#mainApp :is(.kpi-tone-neutral,.kpi-tone-support,.kpi-tone-success,.kpi-tone-info) :is(.metric-icon,.product-kpi-icon){
  background:#F1F3F4!important;color:#5E6870!important;border-color:transparent!important
}
#mainApp :is(.kpi-tone-success,.kpi-tone-info,.kpi-tone-warning) :is(.metric-value,.product-kpi-value){color:var(--app-ink)!important}
#mainApp .kpi-tone-warning :is(.metric-icon,.product-kpi-icon){background:#F1F3F4!important;color:var(--status-warning)!important;border-color:transparent!important}
#mainApp :is(.notice.info),#modalRoot :is(.notice.info){
  background:#F6F7F8!important;color:#3A4148!important;border-color:var(--app-border)!important
}
#mainApp .notice.info strong,#modalRoot .notice.info strong{color:var(--app-ink)!important}
#modalRoot .modal-close:focus-visible{outline-width:2px!important;box-shadow:none!important}

/* Two or three summary tiles fill the row instead of leaving gaps. */
#mainApp .product-kpis.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
#mainApp .product-kpis.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}
@media(max-width:520px){#mainApp .product-kpis.grid-3{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* New customer on mobile: label above the field, not squeezed next to it. */
@media(max-width:820px){
  #modalRoot #contactForm[data-mobile-customer-flow]>.field,
  #modalRoot #contactForm[data-mobile-customer-flow] .mobile-contact-more-body>.field{flex-direction:column;align-items:stretch}
}

/* One calm look everywhere: no shadows, one page grey, one card style, one set of greys and greens.
   Palette: ink #1B1F23, brand #63D471, page #F6F7F8, surface #FFFFFF, quiet #8A949C. */
html body :is(#mainApp,#modalRoot,#mobileBottomNav,#authRoot,#toastRoot) :not(:focus-visible),
html body :is(#mainApp,#modalRoot,#mobileBottomNav,#authRoot) :not(:focus-visible)::before,
html body :is(#mainApp,#modalRoot,#mobileBottomNav,#authRoot) :not(:focus-visible)::after,
html body #modalRoot .modal,html body #mobileBottomNav{box-shadow:none!important;text-shadow:none!important}
html body #mainApp :is(.main,.content,#appMain,#content){background:#F6F7F8!important}

/* Cards: white, one thin border on every side, no raised top edge. */
html body #mainApp#mainApp :is(.card,.product-kpi,.metric,.dashboard-kpi,.dashboard-summary-card){
  background:#FFFFFF!important;border:1px solid #E4E7EA!important;
}


/* Icon tiles: the same quiet tile on every card. */
html body #mainApp#mainApp :is(.metric-icon,.product-kpi-icon){background:#F1F3F4!important;color:#5E6870!important;border:0!important}

/* One soft green for "active" and "done", one readable green for its text. */
html body :is(#mainApp#mainApp,#modalRoot#modalRoot,#mobileBottomNav#mobileBottomNav) :is(.nav-item.active,.mobile-bottom-nav-item.active,.badge.good,.dashboard-attention-state.success,.settings-center-row[aria-current="true"],.filter-btn.active,.invoice-check){background:#ECFAEE!important}
html body :is(#mainApp,#modalRoot) :is(.badge.good,.dashboard-attention-state.success,.settings-center-status.good){color:#177A31!important}
html body #mainApp #cloudSyncBadge::before{content:none!important}
html body #mainApp .status-dot.ok{background:#63D471!important}

/* Neutral badges instead of blue, red only where something is wrong. */
html body :is(#mainApp,#modalRoot) .badge:not(.good):not(.bad):not(.warn):not(.info):not(.info){color:#3A4148}

/* Greys: one border, one strong border for fields and buttons, one quiet fill. */
html body :is(#mainApp,#modalRoot) :is(.list-search-box,.list-filter-chips,.divider){border-color:#E4E7EA!important}
html body :is(#mainApp,#modalRoot) .divider{background:#E4E7EA!important}
html body #modalRoot .modal-close{background:#F1F3F4!important;color:#1B1F23!important}
html body #mainApp #accountAvatar{background:#F1F3F4!important;border-color:#E4E7EA!important;color:#1B1F23!important}

/* Text greys: ink for content, one grey for labels and help, the light grey only for chevrons. */
html body :is(#mainApp,#modalRoot) :is(label,.field>span,.bar-label,.help,.critical-help,.settings-center-group-label,.report-period-adjust){color:#5E6870!important}
html body :is(#mainApp,#modalRoot) .link-btn{color:#1B1F23!important;text-decoration:underline;text-underline-offset:2px}

/* "Factuur maken" on the overview: a normal card, the green stays on the button. */
html body #mainApp :is(.dashboard-summary-card.primary,.dashboard-summary-card.is-primary,.dashboard-new-invoice){background:#FFFFFF!important;border-color:#E4E7EA!important}

/* Messages float above the page with a line instead of a shadow. */
html body #toastRoot>*{border:1px solid #E4E7EA!important}
html body :is(#mainApp,#modalRoot) :is(.row-action-trigger,.invoice-advanced-options,.secondary-disclosure){border-color:#E4E7EA!important}
html body :is(#mainApp,#modalRoot) .customer-preview{background:#F6F7F8!important}
html body #mainApp .progress{background:#F1F3F4!important}
html body :is(#mainApp,#modalRoot) .settings-nav-chevron{color:#8A949C!important}
html body :is(#mainApp,#modalRoot) :is(.settings-center-row span,.badge:not(.good):not(.bad):not(.warn):not(.info)){color:#5E6870!important}
html body #modalRoot .action-row strong:not(.is-danger strong){color:#1B1F23!important}
html body #mainApp .settings-center-row.danger :is(strong,.settings-center-icon){color:#C2362B!important}

/* Date fields: on iPhone a date field keeps its own minimum width and can push past the screen.
   Make every date field fill its box like the other fields, and never wider. */
html body :is(#mainApp,#modalRoot) :is(input[type="date"],input[type="month"],input[type="time"],input[type="datetime-local"]){
  -webkit-appearance:none;appearance:none;display:block;box-sizing:border-box;
  width:100%!important;min-width:0!important;max-width:100%!important;
  margin:0;background-color:#FFFFFF;text-align:left;
}
html body :is(#mainApp,#modalRoot) :is(input[type="date"],input[type="month"],input[type="time"],input[type="datetime-local"])::-webkit-date-and-time-value{text-align:left;margin:0;min-height:1.2em}
html body :is(#mainApp,#modalRoot) :is(.field,.form-grid>*,.grid>*){min-width:0}

/* Small phones: the save status shrinks to a dot-sized tick so the top bar stays on one line. */
@media(max-width:374px){
  html body #mainApp #cloudSyncBadge.badge.good:not(.hidden){font-size:0!important;padding:0!important;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}
  html body #mainApp #cloudSyncBadge.badge.good:not(.hidden)::after{content:"✓";font-size:14px}
}

/* Phone top bar: everything stays on one line. A failed save is one small pill you tap to try again,
   instead of a red label with a separate link wrapping under it and pushing "+" off the screen. */
@media(max-width:820px){
  html body #mainApp .top-actions{flex-wrap:nowrap!important;max-width:none!important;min-width:0;align-items:center}
  html body #mainApp #cloudSyncRetry{display:none!important}
  html body #mainApp #cloudSyncBadge.badge.bad:not(.hidden){font-size:0!important;padding:0 12px!important;height:32px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer;background:#FFF7E6!important;color:#8A5300!important;border:1px solid #F3D9A4!important}
  html body #mainApp #cloudSyncBadge.badge.bad:not(.hidden)::after{content:"Opnieuw opslaan";font-size:12px;font-weight:700}
  html body #mainApp .topbar :is(#quickNew,#mobileMenu){flex:0 0 auto}
  html body #mainApp .topbar .page-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:374px){
  html body #mainApp #cloudSyncBadge.badge.bad:not(.hidden)::after{content:"Opslaan"}
}

/* Chart colours: omzet green, kosten red, winst blue. Same in the overview, reports and the cost categories. */
html body #mainApp#mainApp :is(.bar.sales,.legend-dot:not(.cost):not(.profit)){background:#63D471!important}
html body #mainApp#mainApp :is(.bar.costs,.legend-dot.cost,.category-row .progress span){background:#E5534B!important}
html body #mainApp#mainApp :is(.bar.profit,.bar.profit.loss,.legend-dot.profit){background:#3B82F6!important}
