:root {
  --brand: #DC018F;
  --brand-dark: #A8006D;
  --brand-tint: #FCE4F2;
  --ground: #F6F5F1;
  --card: #FFFFFF;
  --line: #E3E1DA;
  --ink: #1A1F1C;
  --muted: #5B635E;
  --ok: #1E7A4C;
  --warn: #A15C00;
  --danger: #B5391F;
  --radius: 16px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-dark); }
h1, h2, h3 { margin: 0; font-family: var(--display); }
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* knoppen */
.btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { border-color: #C9C6BC; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #EBC7BE; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; }
.big-btn { width: 100%; height: 64px; border: 0; border-radius: var(--radius); font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.big-btn.go { background: var(--brand); color: #fff; }
.big-btn.go:hover { background: var(--brand-dark); }
.big-btn.out { background: var(--danger); color: #fff; }
.big-btn.ghost { background: #fff; color: var(--brand-dark); border: 2px solid var(--brand); }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }

/* kaarten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.pill { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.grey { background: #ECEAE4; color: var(--muted); }
.pill.ok { background: #E0F1E7; color: var(--ok); }
.stat { font-family: var(--display); font-size: 24px; font-weight: 700; }

/* formulieren */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 700; }
.field small { color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea { min-height: 48px; padding: 10px 14px; border: 1px solid #CFCCC2; border-radius: 12px; background: #fff; }
.field textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.form-error { color: var(--danger); font-weight: 600; margin: 0 0 12px; min-height: 1px; }
.form-error:empty { display: none; }

/* dialoog */
.dlg { border: 0; border-radius: 20px; padding: 0; width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(26,31,28,.45); }
.dlg form { padding: 20px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dlg-head h2 { font-size: 22px; }
.dlg-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* melding */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--danger); }

/* inlogscherm */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.login-brand { display: flex; flex-direction: column; gap: 4px; margin-bottom: 28px; }
.login-brand .mark { width: 56px; height: 56px; border-radius: 16px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.login-brand h1 { font-size: 30px; }

/* medewerker-app */
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.app-head { background: var(--brand); color: #fff; padding: calc(env(safe-area-inset-top) + 20px) 20px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.app-head small { font-size: 13px; font-weight: 500; opacity: .9; }
.app-head h1 { font-size: 24px; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: rgba(255,255,255,.2); border: 0; color: #fff; font-weight: 700; font-size: 15px; }
.app-main { flex: 1; padding: 20px 20px 110px; display: flex; flex-direction: column; gap: 16px; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px); z-index: 10; }
.tabbar-inner { max-width: 520px; }
.tab { height: 56px; border: 0; background: transparent; color: #6B726E; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 700; }
.tab[aria-current="page"] { color: var(--brand-dark); }
.clock-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 20px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.status .dot { width: 10px; height: 10px; border-radius: 5px; background: currentColor; }
.timer { font-family: var(--display); font-size: 56px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.shift-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.shift-time { font-family: var(--display); font-size: 26px; font-weight: 700; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stats .card { padding: 16px; border-radius: var(--radius); }
.week-nav { display: flex; justify-content: space-between; align-items: center; }
.week-nav .t { text-align: center; }
.week-nav h2 { font-size: 20px; }
.day { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.day.off { background: transparent; border-style: dashed; border-color: #D3D0C7; }
.day.today { border: 2px solid var(--brand); }
.day-date { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); padding-right: 14px; width: 58px; }
.day-date .dow { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.day-date .num { font-family: var(--display); font-size: 22px; font-weight: 700; }
.day-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.day-shift { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-shift b { font-size: 17px; }
.colleagues { font-size: 13px; color: var(--muted); }
.hero { background: var(--brand); color: #fff; border-radius: 20px; padding: 20px; }
.hero .stat { font-size: 40px; }
.hero small { opacity: .9; font-size: 14px; }
.entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); }
.entry b { font-size: 15px; }
.entry .sub { font-size: 13px; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--brand-dark); font-weight: 700; text-decoration: underline; min-height: 44px; padding: 8px; }
.empty { text-align: center; color: var(--muted); padding: 24px 12px; }

/* beheerscherm */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.side .brand .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.side .brand b { font-family: var(--display); font-size: 17px; line-height: 1.15; }
.nav-btn { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; font-weight: 700; color: var(--muted); text-align: left; }
.nav-btn:hover { background: var(--ground); color: var(--ink); }
.nav-btn[aria-current="page"] { background: var(--brand-tint); color: var(--brand-dark); }
.nav-btn .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 12px; padding: 2px 8px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; font-size: 14px; }
.content { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 30px; margin-right: auto; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=date] { min-height: 44px; padding: 0 12px; border: 1px solid #CFCCC2; border-radius: 12px; background: #fff; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; background: #FBFAF7; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-roster th:first-child, .grid-roster td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 150px; }
.grid-roster th.today { color: var(--brand-dark); }
.grid-roster td { min-width: 120px; padding: 8px; }
.shift-chip { display: block; width: 100%; text-align: left; background: var(--brand-tint); border: 0; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; color: var(--brand-dark); font-weight: 700; font-size: 14px; min-height: 44px; }
.shift-chip small { display: block; font-weight: 500; font-size: 12px; color: var(--ink); }
.add-chip { width: 100%; min-height: 36px; border: 1px dashed #CFCCC2; border-radius: 10px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.add-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.add-chip svg { width: 18px; height: 18px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.live-card { display: flex; flex-direction: column; gap: 6px; }
.live-card .timer { font-size: 32px; }
.diff-pos { color: var(--ok); font-weight: 700; }
.diff-neg { color: var(--danger); font-weight: 700; }
.section-gap { margin-top: 28px; }
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
  .mobile-nav .nav-btn { white-space: nowrap; flex: none; }
  .content { padding: 20px 16px 60px; }
  .page-head h1 { font-size: 24px; }
}
.shift-row b { text-align: right; }
a.btn { text-decoration: none; color: var(--ink); }
a.btn.primary { color: #fff; }
.entry > b { white-space: nowrap; }
