/* Aceluvia Finance – vormgeving */
:root {
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --line-2: #f1f5f9;
  --bg: #f4f6fb; --card: #fff;
  --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: #eff4ff; --accent-ink: #fff;
  --ok: #15803d; --ok-soft: #e8f7ee; --warn: #b45309; --warn-soft: #fdf3e2; --err: #b91c1c; --err-soft: #fdecec;
  --sb-bg: #0f1c33; --sb-ink: #c7d2e5; --sb-muted: #7486a6; --sb-hover: #182a4a; --sb-active: #22396a;
  --sb-w: 248px; --radius: 14px; --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
.sb-collapsed { --sb-w: 76px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); line-height: 1.5; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.ico { width: 20px; height: 20px; flex: none; }

/* --- Indeling met menu links --- */
body.app { display: grid; grid-template-columns: var(--sb-w) 1fr; transition: grid-template-columns .2s ease; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sb-bg); color: var(--sb-ink);
           display: flex; flex-direction: column; overflow: hidden; z-index: 30; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1rem 1rem 1.1rem; gap: .5rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 700; color: #8fb3ff; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 800;
        background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; box-shadow: 0 4px 12px rgba(59,130,246,.35); }
.sb-collapse, .sb-logout { background: none; border: 0; color: var(--sb-muted); padding: .35rem; border-radius: 8px;
                            cursor: pointer; display: grid; place-items: center; }
.sb-collapse:hover, .sb-logout:hover { background: var(--sb-hover); color: #fff; }
.sb-collapse .ico { transition: transform .2s; }
.sb-nav { flex: 1; overflow-y: auto; padding: .25rem .7rem 1rem; }
.sb-nav a { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; margin: 2px 0; border-radius: 10px;
            color: var(--sb-ink); white-space: nowrap; font-weight: 500; }
.sb-nav a:hover { background: var(--sb-hover); color: #fff; text-decoration: none; }
.sb-nav a.active { background: var(--sb-active); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.sb-nav a.active .ico { color: #93c5fd; }
.sb-sec { margin: 1.1rem .7rem .35rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
          color: var(--sb-muted); font-weight: 600; white-space: nowrap; height: 1rem; }
.sb-foot { border-top: 1px solid rgba(255,255,255,.07); padding: .8rem 1rem; display: flex; align-items: center;
           justify-content: space-between; gap: .5rem; }
.me { display: flex; align-items: center; gap: .6rem; min-width: 0; white-space: nowrap; }
.me .lbl { overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2b4373; color: #fff; display: grid;
          place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.sb-collapsed .sidebar .lbl { display: none; }
.sb-collapsed .sb-head { flex-direction: column; padding: 1rem .5rem; }
.sb-collapsed .sb-collapse .ico { transform: rotate(180deg); }
.sb-collapsed .sb-nav a { justify-content: center; padding: .6rem; }
.sb-collapsed .sb-sec { margin: .8rem .4rem .3rem; border-top: 1px solid rgba(255,255,255,.08); height: 0; }
.sb-collapsed .sb-foot { flex-direction: column; padding: .8rem .4rem; }
.sb-overlay { display: none; }

.page { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem 2rem;
          background: rgba(244, 246, 251, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 60px; }
.menu-btn { display: none; background: none; border: 0; padding: .3rem; color: var(--ink); cursor: pointer; }
.entity-name { font-weight: 600; }
.seg { display: inline-flex; background: #e6eaf2; border-radius: 12px; padding: 3px; gap: 2px; }
.seg form { margin: 0; }
.seg button { border: 0; background: transparent; padding: .4rem .95rem; border-radius: 9px; font-weight: 600;
              color: var(--ink-2); font-size: .9rem; cursor: pointer; box-shadow: none; }
.seg button.on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
main { width: 100%; max-width: 1240px; padding: 1.6rem 2rem 3rem; }

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%);
             transition: transform .22s ease; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .sb-collapsed .sidebar .lbl { display: inline; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 25; }
  .menu-btn { display: grid; }
  .topbar { padding: .6rem 1rem; }
  main { padding: 1.1rem 1rem 2.5rem; }
}

/* --- Inhoud --- */
h1 { font-size: 1.6rem; letter-spacing: -.02em; margin: .2rem 0 1.2rem; font-weight: 700; display: flex;
     align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.05rem; margin: .2rem 0 .9rem; font-weight: 650; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem;
        margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.card > table:first-child, .card > h2 + table { margin-top: -.2rem; }
.card:has(> table:only-child) { padding: .4rem .6rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
     border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #fafbfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn, button { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--card);
               color: var(--ink); border-radius: 10px; padding: .55rem 1rem; font: inherit; font-size: .92rem; font-weight: 550;
               cursor: pointer; text-decoration: none; line-height: 1.2; box-shadow: 0 1px 2px rgba(15,23,42,.04);
               transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover, button:hover { text-decoration: none; border-color: #cbd5e1; background: #f8fafc; }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
                               box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn.primary:hover, button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger, button.danger { color: var(--err); border-color: #f3c4c4; }
.btn.danger:hover, button.danger:hover { background: var(--err-soft); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 0 0 1.2rem; }
form.inline { display: inline; }

label { display: block; font-size: .84rem; color: var(--ink-2); margin-bottom: .3rem; font-weight: 550; }
input, select, textarea { font: inherit; padding: .6rem .75rem; border: 1px solid #d5dce6; border-radius: 10px; width: 100%;
                          background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem 1.2rem; }
.field { margin-bottom: .2rem; }
.help { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.errorlist { color: var(--err); margin: .3rem 0; padding-left: 1rem; font-size: .86rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.messages li { padding: .8rem 1rem; border-radius: 12px; margin-bottom: .5rem; background: var(--accent-soft);
               border: 1px solid #d6e2fd; color: #1e3a8a; }
.messages li.success { background: var(--ok-soft); border-color: #c4e8d2; color: #14532d; }
.messages li.error { background: var(--err-soft); border-color: #f5c7c7; color: #7f1d1d; }
.messages li.warning { background: var(--warn-soft); border-color: #f1d7a8; color: #78350f; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 99px; font-size: .76rem;
         font-weight: 600; background: #eef1f6; color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.draft { background: #eef1f6; color: #475569; }
.badge.submitted { background: var(--warn-soft); color: var(--warn); }
.badge.posted { background: var(--ok-soft); color: var(--ok); }
.muted { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat { display: block; color: var(--ink); position: relative; overflow: hidden; margin: 0; }
.stat:hover { text-decoration: none; border-color: #c7d6f5; }
.stat .n { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; color: var(--ink); }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%;
               background: var(--accent-soft); }
.lines td input, .lines td select { min-width: 90px; }

/* --- Inlogscherm --- */
body.guest { min-height: 100vh; display: grid; place-items: center;
             background: radial-gradient(1200px 600px at 10% -10%, #3b5bdb33, transparent),
                         radial-gradient(900px 500px at 110% 110%, #6366f133, transparent), #0f1c33; }
body.guest .page { min-height: auto; width: 100%; }
body.guest main { max-width: 440px; margin: 0 auto; padding: 2rem 1rem; }
.login { padding: 2.2rem 2rem; border: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login h1 { margin-bottom: .4rem; }
.login .actions { margin: 1.4rem 0 0; }
.login .actions button { width: 100%; justify-content: center; padding: .75rem; }
.login .brand { color: var(--ink); margin-bottom: 1.4rem; }
.login .brand b { color: var(--accent); }

/* --- Overzicht --- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.page-head .actions { margin: 0; }
.eyebrow { margin: 0 0 .2rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.btn .ico, button .ico { width: 17px; height: 17px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.kpi { display: flex; flex-direction: column; gap: .2rem; margin: 0; color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: #c7d6f5; }
.k-label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.k-value { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.k-sub { font-size: .84rem; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.2rem; }
.dash-grid .card { margin-bottom: 1.2rem; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; height: 210px; padding-top: .4rem; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; cursor: default; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center;
             border-bottom: 1px solid var(--line); }
.bar { width: 62%; max-width: 30px; min-height: 2px; background: #93b4f5; border-radius: 4px 4px 0 0; transition: background .15s; }
.bar-col.current .bar, .bar-col:hover .bar { background: var(--accent); }
.bar-lbl { font-size: .72rem; color: var(--muted); padding-top: .4rem; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li a { display: flex; justify-content: space-between; align-items: center; padding: .7rem .2rem; color: var(--ink);
             border-bottom: 1px solid var(--line-2); }
.todo li:last-child a { border-bottom: 0; }
.todo li a:hover { text-decoration: none; color: var(--accent); }
.pill { min-width: 1.9rem; text-align: center; padding: .1rem .55rem; border-radius: 99px; background: #eef1f6; font-size: .85rem; }
.pill.hot { background: var(--warn-soft); color: var(--warn); }

/* --- Inkoopfactuur uploaden en controleren --- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .4rem;
            min-height: 260px; border: 2px dashed #c3cfe3; border-radius: var(--radius); background: #fff; cursor: pointer;
            padding: 2rem; color: var(--ink-2); transition: border-color .15s, background .15s; margin: 0; font-size: 1rem; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.dz-icon .ico { width: 28px; height: 28px; }
.dz-title { font-weight: 650; font-size: 1.1rem; color: var(--ink); }
.dz-sub { color: var(--muted); font-size: .9rem; max-width: 460px; }
.dz-file { font-weight: 600; color: var(--accent); }
.with-preview { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.wp-doc { position: sticky; top: 76px; padding: .5rem; height: calc(100vh - 100px); }
.wp-doc iframe, .wp-doc img { width: 100%; height: 100%; border: 0; border-radius: 10px; object-fit: contain; }
@media (max-width: 1100px) { .with-preview { grid-template-columns: 1fr; } .wp-doc { position: static; height: 70vh; } }
.extract-note { background: var(--accent-soft); border-color: #d6e2fd; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.chip { font-size: .8rem; padding: .15rem .55rem; border-radius: 99px; font-weight: 600; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.miss { background: var(--warn-soft); color: var(--warn); }

.card:has(> table.lines) { overflow-x: auto; }
.wp-form .lines td input, .wp-form .lines td select { min-width: 110px; }

.extract-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.2rem; margin-top: .9rem; }
@media (max-width: 700px) { .extract-grid { grid-template-columns: 1fr; } }
table.mini td, table.mini th { padding: .25rem .4rem; font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
table.mini tr:hover td { background: none; }
.remember { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin-top: .6rem; }

/* --- Salarisportal --- */
.sub-nav { display: flex; width: fit-content; max-width: 100%; margin: -.4rem 0 1.2rem; flex-wrap: wrap; }
.sub-nav a { padding: .4rem .95rem; border-radius: 9px; font-weight: 600; color: var(--ink-2); font-size: .9rem; }
.sub-nav a:hover { text-decoration: none; color: var(--accent); }
.sub-nav a.on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.month-pick { align-items: center; }
.month-pick input { width: auto; }
tr.total td { border-top: 1.5px solid var(--ink-2); }
.sub-nav-2 { background: transparent; padding: 0 0 0 .9rem; margin-top: -.5rem; border-left: 3px solid var(--accent); align-items: center; }
.sub-nav-2::before { content: attr(data-label); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: .6rem; }
.sub-nav-2 a { font-size: .85rem; padding: .3rem .8rem; }
.sub-nav-2 a.on { background: var(--accent-soft); box-shadow: none; }

/* Activa: vinkje op inkoopregels en afschrijvingsbalkje */
.cap-cell { white-space: nowrap; }
.cap-wrap { display: flex; align-items: center; gap: .5rem; min-height: 38px; }
.cap-wrap .cap-toggle, .cap-wrap .cap-life { display: none; }
.cap-wrap .cap-none { color: var(--muted); font-size: .82rem; }
.cap-wrap.is-big .cap-toggle { display: inline-flex; }
.cap-wrap.is-big .cap-none, .cap-wrap.is-on .cap-none { display: none; }
.cap-wrap.is-on .cap-life { display: inline-block; }
.cap-toggle { align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; cursor: pointer; margin: 0;
  padding: .35rem .6rem; border: 1px solid var(--line, #e3e8f0); border-radius: 999px; background: #fff; }
.cap-wrap.is-on .cap-toggle { background: #eef3ff; border-color: #b9cdf7; color: var(--accent); }
.cap-input input { width: auto; margin: 0; }
.cap-life select { min-width: 8.5rem; }
.th-help { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: #eef1f6; color: var(--muted); font-size: .7rem; cursor: help; }
select:disabled { background: #f4f6fa; color: var(--muted); }
.dep-track { height: 5px; background: #edf0f5; border-radius: 99px; margin-top: .35rem; overflow: hidden; min-width: 90px; }
.dep-track span { display: block; height: 100%; background: linear-gradient(90deg, #93b4f5, var(--accent)); border-radius: 99px; }
.small { font-size: .8rem; }
tr.total th { border-top: 1.5px solid var(--ink-2); }
.notice.warn { background: var(--warn-soft); border-color: #f1d7a8; color: #78350f; }
button:disabled { opacity: .55; cursor: not-allowed; }
.cap-toggle input[type="checkbox"] { width: 1rem !important; height: 1rem; min-width: 0; padding: 0; margin: 0;
  border: 0; box-shadow: none; background: none; accent-color: var(--accent); }
.cap-input { display: inline-flex; }
/* Regel verwijderen met een kruisje */
th.del-col, td.del-col { width: 2.4rem; text-align: center; padding-left: .2rem; padding-right: .2rem; }
.line-del { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; margin: 0;
  color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; transition: background .15s, color .15s; }
.line-del:hover { background: var(--err-soft); color: var(--err); }
.line-del input { position: absolute; opacity: 0; width: 1px !important; height: 1px; pointer-events: none; }
tr.is-deleted { display: none; }
button.line-del { border: 0; background: none; padding: 0; box-shadow: none; min-height: 0; }
button.line-del:hover { background: var(--err-soft); }
.small-btn { padding: .3rem .7rem; font-size: .82rem; }

/* Testomgeving: rode balk op elk scherm */
.test-banner { background: #c0262d; color: #fff; text-align: center; font-weight: 700; letter-spacing: .04em;
  padding: .45rem 1rem; font-size: .85rem; }

/* --- Startpagina invoerder --- */
.entry-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.entry-tile { display: flex; align-items: center; gap: 1rem; margin: 0; color: var(--ink); padding: 1.3rem 1.4rem; }
.entry-tile:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.entry-tile .et-ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: none;
                      background: var(--accent-soft); color: var(--accent); }
.entry-tile .et-ico .ico { width: 24px; height: 24px; }
.entry-tile .et-text { display: flex; flex-direction: column; flex: 1; }
.entry-tile .et-text strong { font-size: 1.1rem; }
.entry-tile .et-text small { color: var(--muted); }
.entry-tile .et-arrow { font-size: 1.6rem; color: var(--muted); }
.entry-grid { grid-template-columns: 1fr 2fr; margin-bottom: 1.2rem; align-items: start; }
.entry-grid > :only-child { grid-column: 1 / -1; }
@media (max-width: 900px) { .entry-grid { grid-template-columns: 1fr; } }

/* --- Gebruikersprofiel kiezen --- */
.profiles { display: grid; gap: .5rem; margin-bottom: 1rem; }
.profile-opt { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--line);
               border-radius: 10px; cursor: pointer; font-weight: 400; }
.profile-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.profile-opt input { margin-top: .25rem; }
.entry-grid ~ .card .badge { white-space: nowrap; }
@media (max-width: 600px) { .hide-sm { display: none; } }
