/* Urenregistratie Douchebox — look based on douchebox.nl (spec §6). */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/poppins-latin-700-normal.woff2") format("woff2"); }

:root {
  --accent: #009FE3;          /* logo blue: lines, active tab, accents (not under white text) */
  --primary: #007DB8;         /* buttons (white text passes 4.5:1) */
  --primary-hover: #00669A;
  --heading: #121F38;
  --text: #393939;
  --muted: #5F6B76;
  --bg: #F5F5F5;
  --card: #FFFFFF;
  --border: #E3E8EC;
  --line: #EEF1F4;
  --input-border: #C9D3DC;
  --open-bg: #FFF4E5;
  --open-fg: #9A4D00;
  --paid-bg: #E5F5FC;
  --paid-fg: #00669A;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

h1 { margin: 0 0 16px; font-size: 22px; font-weight: 600; color: var(--heading); line-height: 1.3; }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; color: var(--heading); }
h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--heading); }
p { margin: 0 0 12px; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.icon { flex-shrink: 0; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--card);
  border-bottom: 3px solid var(--accent);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px; min-height: 60px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); font-weight: 600; font-size: 18px; }
.brand img { display: block; max-height: 36px; width: auto; }
.mainnav, .usermenu { display: none; }
.phone-user { margin-left: auto; font-size: 14px; font-weight: 500; color: var(--heading); }
.mainnav a { padding: 10px 14px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.mainnav a:hover { background: var(--line); }
.mainnav a[aria-current="page"] { background: var(--paid-bg); color: var(--paid-fg); font-weight: 600; }
.usermenu { align-items: center; gap: 14px; font-size: 14px; margin-left: auto; }
.username { font-weight: 500; color: var(--heading); }

/* ---------- Phone tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--card); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--muted); text-decoration: none; border-top: 3px solid transparent;
}
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 600; border-top-color: var(--accent); }

/* ---------- Page ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 100px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }

.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.strong { font-weight: 600; color: var(--heading); }
.big { font-size: 24px; font-weight: 700; color: var(--heading); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .side { flex: 1 1 260px; }
.split > .main { flex: 999 1 560px; min-width: 0; }

/* ---------- Messages ---------- */
.flash { background: var(--paid-bg); color: var(--paid-fg); padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; }
.error { background: var(--danger-bg); color: var(--danger); padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; }
ul.error { padding-left: 32px; }
.notice { background: var(--paid-bg); color: var(--paid-fg); padding: 10px 14px; border-radius: 12px; font-size: 14px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--heading); }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: #FFFFFF;
  min-height: 48px; width: 100%; padding: 0 12px;
  border: 1px solid var(--input-border); border-radius: 10px;
}
textarea { padding: 10px 12px; min-height: 80px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--primary); margin: 0; }

/* Date field: dd-mm-jjjj text + calendar button; the native date input only hosts the browser's picker. */
.date-input { position: relative; display: flex; gap: 6px; align-items: stretch; }
.date-input > input[type="text"] { flex: 1 1 auto; min-width: 8.5em; }
.date-input-btn {
  flex: 0 0 48px; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0; border: 1px solid var(--input-border); border-radius: 10px;
  background: #FFFFFF; color: var(--primary); cursor: pointer;
}
.date-input-btn:hover { border-color: var(--primary); }
.date-input-btn[hidden] { display: none; }
.date-input-native {
  position: absolute; right: 0; bottom: 0; width: 48px; height: 48px; min-height: 0;
  padding: 0; border: 0; opacity: 0; pointer-events: none;
}
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 400; color: var(--text); }
.inline { display: inline; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover { background: var(--primary-hover); color: #FFFFFF; }
.btn-secondary { background: #FFFFFF; color: var(--heading); border-color: var(--input-border); }
.btn-secondary:hover { background: var(--line); color: var(--heading); }
.btn-danger { background: #FFFFFF; color: var(--danger); border-color: #F1B8B2; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-small { min-height: 40px; padding: 0 12px; font-size: 14px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-icon { min-height: 44px; min-width: 44px; padding: 0; background: transparent; border: 0; color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; }

.worked {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px;
  background: var(--paid-bg); color: var(--paid-fg); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 500;
}
.worked-value { font-size: 22px; font-weight: 700; color: var(--heading); }
.worked-error { background: var(--open-bg); color: var(--open-fg); }

/* ---------- Status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip-open { background: var(--open-bg); color: var(--open-fg); }
.chip-unlocked { background: var(--open-bg); color: var(--open-fg); border: 1px dashed #D9A35F; }
.chip-paid { background: var(--paid-bg); color: var(--paid-fg); font-weight: 500; }
.chip-muted { background: var(--line); color: var(--muted); font-weight: 500; }

/* ---------- Logo settings ---------- */
.logo-row { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.logo-preview { width: 240px; height: 80px; border: 1px dashed var(--input-border); border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 8px; background: #FFFFFF; }
.logo-preview img { max-width: 100%; max-height: 100%; }
input[type="file"] { padding: 10px 12px; }
.auth-subtitle { text-align: center; font-size: 20px; font-weight: 600; color: var(--heading); margin-top: -12px; }

/* ---------- Switch (Collega's zien) ---------- */
.switch {
  width: 52px; height: 30px; padding: 3px; border: 0; border-radius: 15px; background: var(--input-border);
  display: inline-flex; justify-content: flex-start; vertical-align: middle; cursor: pointer; margin-right: 6px;
}
.switch[aria-checked="true"] { background: var(--primary); justify-content: flex-end; }
.switch-knob { width: 24px; height: 24px; border-radius: 12px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(18, 31, 56, .3); }

/* ---------- Entry rows (phone-friendly lists) ---------- */
.entries { margin: 0; padding: 0; list-style: none; }
.entry { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.entry-main { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry-day { font-size: 14px; font-weight: 600; color: var(--heading); }
.entry-meta { font-size: 13px; color: var(--muted); }
.entry-flag { font-size: 12px; color: var(--open-fg); }
.entry-total { font-size: 15px; font-weight: 600; color: var(--heading); white-space: nowrap; }
.entry a.entry-link { display: flex; align-items: center; gap: 10px; flex-grow: 1; text-decoration: none; color: inherit; min-width: 0; }
.total-line { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }

/* ---------- Week navigation (Collega's) ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px; }
.week-nav .btn-icon { font-size: 26px; line-height: 1; color: var(--heading); text-decoration: none; }
.week-label { display: flex; flex-direction: column; align-items: center; }

/* ---------- Payments (Mijn uren) ---------- */
details.payment { padding: 0; }
.payment-summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 18px; cursor: pointer; list-style: none; }
.payment-summary::-webkit-details-marker { display: none; }
.payment-icon { width: 34px; height: 34px; border-radius: 17px; background: var(--paid-bg); color: var(--paid-fg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.payment-icon .icon { width: 18px; height: 18px; }
.payment-title { flex-grow: 1; display: flex; flex-direction: column; }
details.payment .entries { padding: 0 18px 8px; }

/* ---------- Payout screen ---------- */
.person-list { display: flex; flex-direction: column; gap: 6px; }
.person-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--heading); text-decoration: none;
}
.person-list a .strong { color: var(--open-fg); }
.person-list a.is-zero, .person-list a.is-zero .strong { color: var(--muted); }
.person-list a[aria-current="page"] { border-color: var(--primary); background: #F0F9FD; }
.pay-footer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 16px 18px; background: #F8FAFB; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.pay-total { flex-grow: 1; display: flex; flex-direction: column; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-btn { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--input-border); background: #FFFFFF; font: inherit; font-size: 13px; color: var(--heading); cursor: pointer; }
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.data tr.selected td { background: #F0F9FD; }
table.data tfoot td { font-weight: 700; color: var(--heading); background: #F8FAFB; border-bottom: 0; }
.sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Menu list (Meer) ---------- */
.menu-list { padding: 6px 0; }
.menu-list a, .menu-button {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 18px; width: 100%;
  color: var(--heading); text-decoration: none; font: inherit; font-size: 16px; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-list a + a, .menu-list form { border-top: 1px solid var(--line); }
.menu-list form { margin: 0; }

/* ---------- Login / auth ---------- */
.auth-body .accent-bar { height: 6px; background: var(--accent); }
.auth { max-width: 420px; margin: 0 auto; padding: 40px 16px; display: flex; flex-direction: column; gap: 24px; }
.auth-brand { display: flex; justify-content: center; font-size: 22px; font-weight: 600; color: var(--heading); }
.auth-brand img { max-height: 64px; max-width: 260px; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  .mainnav { display: flex; flex-wrap: wrap; gap: 4px; flex-grow: 1; }
  .usermenu { display: flex; }
  .phone-user, .tabbar { display: none; }
  .container { padding: 28px 24px 48px; }
  h1 { font-size: 26px; }
}

/* ---------- Print ---------- */
.only-print { display: none; }
.screen-hidden { display: none; }
@media print {
  .topbar, .tabbar, .no-print { display: none !important; }
  .only-print { display: block !important; }
  .print-all { display: block !important; }
  body { background: #FFFFFF; font-size: 11pt; }
  .container { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; margin-bottom: 18px; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
