/* Layout-aanvullingen naast de vooraf gebouwde Tailwind-CSS (app.css).
   Los bestand, zodat het niet verdwijnt als app.css opnieuw wordt gebouwd. */

/* Paginabreedte: gebruik het scherm, tot een leesbare maximale breedte. */
.page { max-width: 1800px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) { .page { padding-left: 32px; padding-right: 32px; } }

/* PDF links, formulier rechts: het formulier krijgt meer ruimte (ca. 40/60). */
.split { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }

/* Boekingsregels: de omschrijving krijgt de ruimte en groeit mee met de tekst. */
#lines .col-desc { min-width: 280px; }
textarea.grow { resize: vertical; min-height: 2.25rem; line-height: 1.35; field-sizing: content; }

/* ------------------------------------------------------------ app-indeling: zijbalk + bovenbalk */
:root { --ink: #14211c; --moss: #2f6b4f; --moss-d: #25563f; --moss-l: #f1f6f3; --line: #e7e5e4; --muted: #78716c; }
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.app.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.sidebar { background: var(--ink); color: #e7efe9; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { height: 56px; display: flex; align-items: center; padding: 0 20px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; }
.sidebar .brand span { color: #8fc5a8; }
.sidebar nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar a.nav, .sidebar button.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #cfe0d6;
  font-size: 14px; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; white-space: nowrap; }
.sidebar a.nav:hover, .sidebar button.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.nav.active { background: var(--moss); color: #fff; }
.sidebar a.sub { padding: 6px 12px 6px 44px; font-size: 13px; }
.sidebar .ico { width: 20px; height: 20px; flex: none; }
.sidebar .bottom { padding: 8px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; }
.sidebar .count { margin-left: auto; font-size: 12px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 0 8px; }
.app.collapsed .sidebar .label, .app.collapsed .sidebar .count, .app.collapsed .sidebar a.sub, .app.collapsed .sidebar .brand span.full { display: none; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.topbar .who { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.topbar .org { color: var(--ink); font-weight: 500; }
.content { padding: 20px 24px 40px; }
.notice { background: #fffbeb; border-bottom: 1px solid #fde68a; color: #78350f; font-size: 12px; text-align: center; padding: 5px 16px; }
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar a.sub, .sidebar .bottom { display: none; }
  .content { padding: 16px; }
}

/* ------------------------------------------------------------ controlescherm */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: fit-content; overflow: hidden; }
.toolbar > * { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 14px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; }
.toolbar > *:last-child { border-right: 0; }
.toolbar > *:hover { background: #f5f5f4; }
.toolbar .primary { background: var(--moss); color: #fff; }
.toolbar .primary:hover { background: var(--moss-d); }
.toolbar [disabled], .toolbar .disabled { opacity: .45; cursor: not-allowed; }
.toolbar .danger { color: #b91c1c; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.formgrid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; align-items: center; padding: 16px 18px; }
.formgrid.two { grid-template-columns: 150px minmax(0, 1fr) 150px minmax(0, 1fr); }
@media (max-width: 1200px) { .formgrid.two { grid-template-columns: 150px minmax(0, 1fr); } }
.formgrid > label { font-size: 14px; color: #44403c; }
.formgrid .req::after { content: " *"; color: #dc2626; }
.fld { width: 100%; border: 1px solid #d6d3d1; border-radius: 6px; padding: 7px 10px; font-size: 14px; background: #fff; }
.fld:focus { outline: none; border-color: var(--moss); box-shadow: 0 0 0 1px var(--moss); }
.fld[readonly] { background: #f5f5f4; color: #57534e; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stepper { display: flex; align-items: stretch; }
.stepper .fld { border-radius: 0; text-align: center; }
.stepper button { border: 1px solid #d6d3d1; background: #fafaf9; padding: 0 10px; color: var(--moss); font-size: 16px; cursor: pointer; }
.stepper button:first-child { border-radius: 6px 0 0 6px; border-right: 0; }
.stepper button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.supplier-row { display: flex; gap: 10px; align-items: center; }
.supplier-row .fld { width: 150px; }
.supplier-row a { color: var(--moss); font-size: 14px; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines th { text-align: left; font-weight: 500; color: #57534e; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.lines td { padding: 6px 8px; border-bottom: 1px solid #f5f5f4; vertical-align: top; }
.lines tr.creditor td { background: #f5f5f4; }
.lines .num { text-align: right; font-family: "JetBrains Mono", ui-monospace, monospace; }
.lines .glname { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lines .total { padding-top: 13px; }
.lines .trash { color: #2563eb; cursor: pointer; display: inline-flex; padding: 8px 4px; }
.lines .trash input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lines tr.removed td { opacity: .35; text-decoration: line-through; }
.addline { color: var(--moss); font-size: 14px; background: none; border: 0; cursor: pointer; padding: 10px 8px; }
.bottomgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .bottomgrid { grid-template-columns: 1fr; } }
.pdfpane { position: sticky; top: 72px; height: calc(100vh - 92px); }
.pdfpane iframe { width: 100%; height: 100%; border: 0; }
.split.review { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .split.review { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; }
.stat .n { font-size: 28px; font-weight: 600; }
.stat a { color: var(--moss); font-size: 13px; }

/* grootboek-suggesties (review.js) */
#gl-suggest { position: absolute; z-index: 50; background: #fff; border: 1px solid #d6d3d1; border-radius: 8px;
              box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; min-width: 340px; font-size: 14px; }
#gl-suggest div { padding: 6px 10px; cursor: pointer; display: flex; gap: 10px; }
#gl-suggest div.active, #gl-suggest div:hover { background: #f1f6f3; }
#gl-suggest .code { font-family: "JetBrains Mono", ui-monospace, monospace; min-width: 48px; color: #25563f; }
#gl-suggest .empty { color: #78716c; cursor: default; }
/* vaste kolombreedtes; de omschrijving krijgt de rest */
.lines { table-layout: fixed; min-width: 760px; }
.lines td { padding: 6px 5px; }
.lines th { padding: 10px 5px; }
.lines .col-desc { min-width: 0; }
