@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --gray: #94a3b8;
  --gray-soft: #f1f5f9;
  --blue: #5985bc;
  --blue-dark: #496d9a;
  --blue-soft: #e6edf5;
  --orange: #f59e0b;
  --orange-soft: #fef3c7;
  --bg: #f4f5f9;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --border: #e6e8ef;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 10px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 28px rgba(16, 24, 40, 0.10), 0 4px 10px rgba(16, 24, 40, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(79, 70, 229, 0.06), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(22, 163, 74, 0.05), transparent),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

main.narrow { max-width: 480px; margin: 0 auto; padding: 28px 20px 64px; }
main.wide { max-width: 960px; margin: 0 auto; padding: 28px 20px 64px; }

h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 26px 0 14px; letter-spacing: -0.01em; }
p.sub { color: var(--muted); margin-top: 0; font-size: 0.95rem; }

a { color: var(--blue); text-decoration: none; font-weight: 500; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease;
}

.center { text-align: center; }

label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

button, .btn {
  display: inline-block;
  background: var(--blue);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.15), 0 2px 6px rgba(79, 70, 229, 0.18);
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button:hover, .btn:hover { background: var(--blue-dark); text-decoration: none; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: #fff; background-image: none; color: var(--text); border: 1.5px solid var(--border); box-shadow: var(--shadow); }
button.secondary:hover, .btn.secondary:hover { background: var(--gray-soft); box-shadow: var(--shadow-md); }
button.danger, .btn.danger { background: var(--red); background-image: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0)); box-shadow: 0 1px 2px rgba(239, 68, 68, 0.2), 0 2px 6px rgba(239, 68, 68, 0.2); }
button.danger:hover, .btn.danger:hover { background: #dc2626; }
button.wide, .btn.wide { width: 100%; margin-top: 16px; }
button.big { width: 100%; padding: 20px; font-size: 1.15rem; margin-bottom: 12px; }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.error {
  background: var(--red-soft); color: #991b1b; border: 1px solid #fecaca;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 0.9rem; font-weight: 500;
}
.success-box {
  background: var(--green-soft); color: #166534; border: 1px solid #bbf7d0;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 0.9rem; font-weight: 500;
}

/* pincode */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 26px 0;
}
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  transition: all 0.15s ease;
}
.pin-dot.filled { background: var(--blue); border-color: var(--blue); transform: scale(1.15); box-shadow: 0 0 0 4px var(--blue-soft); }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 300px;
  margin: 0 auto;
}
.keypad button {
  background: #fff;
  background-image: none;
  color: var(--text);
  border: 1.5px solid var(--border);
  font-size: 1.5rem;
  font-weight: 600;
  padding: 20px 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.keypad button:hover { background: var(--gray-soft); box-shadow: var(--shadow); }
.keypad button:active { background: var(--blue-soft); transform: scale(0.96); }
.keypad button.wipe, .keypad button.enter { font-size: 1rem; color: var(--muted); background: var(--gray-soft); }

.logo-tap { font-size: 3rem; margin-bottom: 8px; filter: drop-shadow(0 4px 10px rgba(79, 70, 229, 0.2)); }

/* action buttons on tap page */
.action-btn { font-size: 1.15rem; padding: 24px; border-radius: var(--radius); }
.action-in { background: var(--green); box-shadow: 0 1px 2px rgba(22, 163, 74, 0.2), 0 4px 10px rgba(22, 163, 74, 0.22); }
.action-in:hover { background: #15803d; }
.action-break_start, .action-break_end { background: var(--orange); box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2), 0 4px 10px rgba(245, 158, 11, 0.22); }
.action-break_start:hover, .action-break_end:hover { background: #d97706; }
.action-out { background: var(--red); box-shadow: 0 1px 2px rgba(239, 68, 68, 0.2), 0 4px 10px rgba(239, 68, 68, 0.22); }
.action-out:hover { background: #dc2626; }

/* dashboard stat row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.stat .label { font-size: 0.74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* omzetdoel voortgangsbalk */
.goal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.goal-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.goal-card-top .goal-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.goal-card-top .goal-percent { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; color: var(--green); }
.goal-bar-track { background: var(--gray-soft); border-radius: 999px; height: 14px; margin-top: 12px; overflow: hidden; }
.goal-bar-fill { background: linear-gradient(90deg, var(--green), #22c55e); height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.goal-card .goal-sub { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }

.emp-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s ease;
}
.emp-row:last-child { border-bottom: none; }
.emp-row:hover { background: var(--gray-soft); border-radius: var(--radius-sm); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(0,0,0,0.03); }
.dot.aanwezig { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.te_laat { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.dot.afwezig { background: var(--gray); box-shadow: 0 0 0 3px var(--gray-soft); }
.dot.klaar { background: #c7cad1; box-shadow: 0 0 0 3px var(--gray-soft); }
.emp-name { font-weight: 700; }
.emp-detail { color: var(--muted); font-size: 0.85rem; margin-top: 1px; }
.emp-meta { margin-left: auto; text-align: right; font-size: 0.85rem; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
table th { color: var(--muted); font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
table tbody tr:hover { background: var(--gray-soft); }
table tbody tr:last-child td { border-bottom: none; }

.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tagcode-box { font-family: 'SF Mono', 'Menlo', monospace; background: var(--gray-soft); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 0.85rem; word-break: break-all; border: 1px solid var(--border); }

.portalnav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.portalnav .brand { font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem; display: flex; align-items: center; }
.portalnav .brand-logo { height: 19px; width: auto; display: block; }
.inline-logo { height: 0.95em; width: auto; vertical-align: -0.15em; }
.portalnav .links { display: flex; gap: 4px; flex-wrap: wrap; }
.portalnav .links a {
  color: var(--muted); font-weight: 600; font-size: 0.9rem;
  padding: 8px 12px; border-radius: 999px; transition: all 0.15s ease;
}
.portalnav .links a:hover { color: var(--text); background: var(--gray-soft); text-decoration: none; }
.portalnav .links a.active { color: var(--blue); background: var(--blue-soft); }
.portalnav .navright { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 0.85rem; color: var(--muted); }
.nav-badge {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px;
  background: var(--red); color: #fff; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; line-height: 1.5; text-align: center;
}

.tiny { font-size: 0.8rem; color: var(--muted); }
.inline-form { display: inline; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; }
.badge.active { background: var(--green-soft); color: #166534; }
.badge.inactive { background: var(--gray-soft); color: var(--muted); }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸ '; color: var(--muted); }
details[open] > summary::before { content: '▾ '; }

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .portalnav { padding: 14px 18px; gap: 10px 16px; }
  .portalnav .links { gap: 2px; }
  .portalnav .links a { padding: 6px 9px; font-size: 0.85rem; }
  main.narrow, main.wide { padding: 20px 16px 48px; }
}

html, body { overflow-x: hidden; }
