:root {
  /* Light orange theme. Change the colours here and every page follows. */
  --primary: #FFB366;        /* light orange: sidebar, top bar, buttons */
  --primary-dark: #F59E42;   /* hover */
  --primary-text: #B85C00;   /* orange used for text on white (passes contrast) */
  --accent: #FFD9B0;         /* soft highlight */
  --bg: #FFF4E8;             /* page background */
  --bg-soft: #FFF9F2;        /* row hover */
  --on-primary: #3B2A1A;     /* dark text on light orange */
  --text-dark: #3B2A1A;
  --muted: #7A6450;
  --border: #F0D5B5;
  --green: #2e8b4a;
  --red: #c9372c;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg);
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 6px; padding: 10px 20px;
  font-weight: 600; font-size: 14px;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline { background: #fff; border: 1px solid var(--primary-dark); color: var(--primary-text); }
.btn-outline:hover { background: var(--bg-soft); }
.btn-gold { background: var(--primary); color: var(--on-primary); width: 100%; padding: 12px; border-radius: 6px; }
.btn-gold:hover { filter: brightness(0.95); }
.btn-link { background: none; color: var(--primary-text); font-weight: 600; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ---------- Landing page ---------- */
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.brand { font-weight: 800; font-size: 20px; }
.brand .accent { color: var(--primary-text); }
.landing-nav .links { display: flex; gap: 30px; font-weight: 600; color: var(--primary-text); }
.landing-nav .actions { display: flex; gap: 10px; }
.hero {
  display: flex; align-items: center; gap: 40px;
  padding: 60px 40px; max-width: 1200px; margin: 0 auto;
}
.hero-copy { flex: 1; }
.hero-copy h1 { font-size: 40px; line-height: 1.25; }
.hero-copy .accent { color: var(--primary-text); }
.hero-copy .accent2 { color: var(--primary-dark); }
.hero-copy p { color: var(--muted); max-width: 480px; }
.hero-actions { display: flex; gap: 14px; margin-top: 20px; }
.hero-images { flex: 1; position: relative; min-height: 420px; }
.hero-images img {
  position: absolute; border-radius: 14px; object-fit: cover; box-shadow: 0 10px 25px rgba(0,0,0,.15);
}
.hero-images .img1 { width: 300px; height: 200px; top: 0; right: 0; }
.hero-images .img2 { width: 260px; height: 170px; top: 130px; left: 0; }
.hero-images .img3 { width: 260px; height: 190px; bottom: 0; right: 40px; }
.dot { position: absolute; border-radius: 50%; background: linear-gradient(135deg,var(--accent),var(--primary-dark)); }

/* ---------- Modal (Login / Signup / Confirm) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: #fff; border-radius: 14px; padding: 30px 34px; width: 380px;
  max-width: 92vw; box-shadow: 0 20px 50px rgba(0,0,0,.2); position: relative;
  max-height: 90vh; overflow-y: auto;
}
.modal-box.wide { width: 520px; }
.modal-close {
  position: absolute; top: 16px; right: 18px; border: none; background: none;
  font-size: 18px; cursor: pointer; color: var(--muted);
}
.modal-title { text-align: center; font-weight: 700; margin: 6px 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.form-error { color: var(--red); font-size: 13px; margin: 6px 0; display: none; }
.form-success { color: var(--green); font-size: 13px; margin: 6px 0; display: none; }
.modal-footer-link { text-align: center; font-size: 13px; margin-top: 12px; color: var(--muted); }
.about-subhead { color: var(--primary-text); margin: 0 0 8px; font-size: 15px; }
.about-text { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 14px; }

/* ---------- Contact Us (modal) ---------- */
.contact-box { background: var(--primary); }
.contact-close { color: var(--on-primary); }
.contact-modal-title {
  text-align: center; color: var(--on-primary); font-family: 'Playfair Display', serif;
  font-weight: 600; font-size: 26px; margin: 6px 0 22px;
}
.contact-grid { display: flex; flex-direction: column; gap: 18px; }
.contact-col h4 { color: #7A3A00; font-size: 14px; margin: 0 0 8px; }
.contact-col p { color: var(--on-primary); font-size: 14px; line-height: 1.6; margin: 0 0 4px; }
.contact-col a { color: var(--on-primary); text-decoration: underline; }

/* ---------- App shell (sidebar + topbar) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--primary); color: var(--on-primary); padding: 20px 0; flex-shrink: 0;
}
.sidebar .brand { color: var(--on-primary); padding: 0 20px 20px; border-bottom: 1px solid rgba(59,42,26,.18); display: flex; align-items: center; gap: 10px; }
.sidebar .brand .accent { color: #7A3A00; }
.brand-logo { width: 34px; height: 34px; flex: none; }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 16px 20px; border-bottom: 1px solid rgba(59,42,26,.18); }
.sidebar-user img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #fff; }
.sidebar-user .status { font-size: 11px; color: #1d5e32; font-weight: 600; }
.sidebar nav { padding: 10px 0; }
.sidebar nav a, .sidebar nav .nav-parent {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: var(--on-primary);
  font-weight: 500; font-size: 14px; cursor: pointer;
}
.sidebar nav a:hover, .sidebar nav .nav-parent:hover { background: rgba(255,255,255,.35); }
.sidebar nav a.active, .sidebar nav .nav-parent.active { background: rgba(255,255,255,.65); color: var(--on-primary); font-weight: 700; }
.sidebar nav .sub-menu { display: none; background: rgba(255,255,255,.22); }
.sidebar nav .sub-menu.open { display: block; }
.sidebar nav .sub-menu a { padding-left: 46px; font-size: 13px; }
.sidebar nav .sub-menu a.active { background: rgba(255,255,255,.65); color: var(--on-primary); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--primary); color: var(--on-primary); display: flex; align-items: center;
  justify-content: space-between; padding: 14px 30px;
}
.topbar h2 { margin: 0; font-size: 18px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 22px; }
.topbar .date { font-size: 12px; text-align: right; line-height: 1.3; }
.topbar .admin-menu { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.topbar .admin-menu img { width: 30px; height: 30px; border-radius: 50%; background: #fff; }
.dropdown {
  position: absolute; top: 42px; right: 0; background: #fff; color: var(--text-dark);
  border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.18); min-width: 150px; overflow: hidden; z-index: 20;
  display: none;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; background: none;
  font-size: 13px; color: var(--text-dark);
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }

.content { padding: 26px 30px; flex: 1; }
.content h1 { margin: 0 0 4px; font-size: 22px; }
.content .subtitle { color: var(--muted); margin: 0 0 20px; font-size: 13px; }

/* ---------- Cards / panels ---------- */
.panel { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 18px; margin-bottom: 20px; }
.panel h3 { margin-top: 0; color: var(--primary-text); font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 12px; }
.tile .value { font-size: 26px; font-weight: 700; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.tile-icon.total { background: var(--accent); color: var(--primary-text); }
.tile-icon.present { background: #dff5e2; color: var(--green); }
.tile-icon.absent { background: #fbdcdc; color: var(--red); }
.tile-icon.leave { background: var(--accent); color: var(--primary-text); }

.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .field { margin-bottom: 0; min-width: 160px; }
.filter-bar .actions { display: flex; gap: 8px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { text-align: left; color: var(--primary-text); font-weight: 700; padding: 10px 8px; border-bottom: 2px solid var(--border); }
tbody td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--bg-soft); }
.status-pill { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-Present, .status-Approved, .status-Active { background: #dff5e2; color: var(--green); }
.status-Absent, .status-Rejected, .status-Inactive { background: #fbdcdc; color: var(--red); }
.status-Late, .status-Pending { background: #fdeecb; color: #a9760f; }
.status-OnLeave { background: #e4e4e4; color: #555; }
.status-Corrected { background: #fdeecb; color: #a9760f; }
.status-Verified { background: #dff5e2; color: var(--green); }

.pagination { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.pagination button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 6px 12px; }
.pagination button.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 700; }
.pagination select { margin-left: auto; padding: 6px; border-radius: 6px; border: 1px solid var(--border); }
.table-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

/* ---------- Employee cards / view / edit ---------- */
.profile-card { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.profile-card img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: #eee; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; row-gap: 10px; column-gap: 20px; font-size: 13px; }
.info-grid .k { color: var(--muted); }
.info-grid .row { display: contents; }

.photo-upload { width: 130px; height: 130px; border-radius: 50%; border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); cursor: pointer; overflow: hidden; margin: 0 auto 16px; }
.photo-upload img { width: 100%; height: 100%; object-fit: cover; }

.toast {
  position: fixed; top: 20px; right: 20px; background: var(--primary); color: var(--on-primary); padding: 12px 18px;
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 2000; display: none; font-size: 14px;
}
.toast.show { display: block; }
.toast.error { background: var(--red); color: #fff; }
.toast.success { background: var(--green); color: #fff; }

.empty-state { text-align: center; padding: 40px; color: var(--muted); }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
}


/* ---------- Focus, form errors, light-orange extras ---------- */
:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 2px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary-dark); outline-offset: 0; border-color: var(--primary-dark); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; margin: 4px 0 0; }
.field-note { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.field input[readonly] { background: var(--bg); color: var(--muted); }
.opt { color: var(--muted); font-weight: 400; }
.brand-logo-lg { width: 44px; height: 44px; vertical-align: middle; margin-right: 8px; }
.landing-nav .brand { display: flex; align-items: center; gap: 10px; }
.modal-logo { display: block; width: 72px; height: 72px; margin: 0 auto 6px; }
.badge-dot { background: var(--primary-text); color: #fff; }

/* ---------- Employee form: address, credentials ---------- */
.addr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.addr-grid > .field { min-width: 0; }
.addr-preview { margin-top: 6px; padding: 10px 14px; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius); }
.addr-preview .k { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.addr-preview pre { margin: 0; font: inherit; white-space: pre-line; line-height: 1.45; }
.addr-preview pre:empty::before { content: "Fill in the address to see how it will print."; color: var(--muted); }
.flash-error { background: #FDECEA; border-left: 4px solid var(--red); color: #7A1913; padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; font-size: 14px; }
.form-note { background: var(--accent); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.lead { color: var(--muted); margin: 0 0 14px; max-width: 640px; }
.cred-panel { border: 2px solid var(--primary); background: #FFF0DC; }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 6px; }
.cred-grid .k { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.cred-copy { display: flex; gap: 8px; align-items: center; }
.cred-copy input { flex: 1; padding: 8px 10px; font: 600 15px ui-monospace, Consolas, monospace; letter-spacing: .03em; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text-dark); }
.row .k { color: var(--muted); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.photo-upload[role="button"] { cursor: pointer; }

/* ---------- QR codes ---------- */
.batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.batch-count { font-weight: 600; min-width: 90px; }
.batch-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.batch-status { min-height: 1.4em; margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.batch-status.is-error { color: var(--red); }
.qr-thumb { display: block; border: 1px solid var(--border); border-radius: 6px; background: #fff; image-rendering: pixelated; }
.muted { color: var(--muted); font-size: 13px; }
.id-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.id-card { background: #fff; border: 1.5px solid var(--primary); border-radius: 14px; padding: 16px; text-align: center; break-inside: avoid; }
.id-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.id-qr { width: 176px; height: 176px; max-width: 100%; display: block; margin: 0 auto 8px; }
.id-name { font-weight: 700; font-size: 16px; margin: 0; overflow-wrap: anywhere; }
.id-no { font-weight: 600; margin: 0; letter-spacing: .04em; }
.id-meta { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.id-note { font-size: 11px; color: var(--muted); margin: 0; }
@media (max-width: 1000px) { .addr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .addr-grid { grid-template-columns: 1fr; } }
@media print {
  @page { size: A4; margin: 0; }                 /* no margin: the browser then prints no date, title or web address on the paper */
  body { background: #fff; padding: 6mm 8mm; }
  .sidebar, .topbar, .no-print, .toast { display: none !important; }
  .app-shell { display: block; min-height: 0 !important; height: auto !important; }
  .content { padding: 0; }
  .id-cards { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .id-card { border-color: #999; border-radius: 4mm; padding: 4mm; }
  .id-qr { width: 44mm; height: 44mm; }
}

/* ---------- QR scanner ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.clock { font-size: 24px; font-weight: 700; color: var(--primary-text); font-variant-numeric: tabular-nums; }
.scan-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.scan-grid > div > .panel + .panel { margin-top: 18px; }
.cam-box { position: relative; aspect-ratio: 4 / 3; background: #1f1812; border-radius: 12px; overflow: hidden; }
.cam-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-frame { position: absolute; inset: 14%; border: 3px solid rgba(255, 179, 102, .9); border-radius: 14px; pointer-events: none; }
.cam-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #e9d9c6; }
.cam-off[hidden] { display: none; }
.cam-controls { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.cam-controls select { padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; max-width: 100%; }
.cam-hint { color: var(--muted); margin: 8px 0 0; font-size: 13px; }
.cam-hint.is-error { color: var(--red); }
.manual { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.manual label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.manual-row { display: flex; gap: 8px; }
.manual-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.result { display: flex; gap: 16px; align-items: center; min-height: 130px; border-left: 8px solid var(--border); }
.result.ok { border-left-color: var(--green); background: #EAF6EE; }
.result.warn { border-left-color: #E09A1F; background: #FFF3DC; }
.result.err { border-left-color: var(--red); background: #FDECEA; }
.result-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; }
.result-title { font-size: 22px; font-weight: 700; }
.result-name { font-size: 18px; margin-top: 2px; }
.result-sub { color: var(--muted); margin-top: 2px; }
.result.idle .result-title { color: var(--muted); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.recent li:last-child { border-bottom: 0; }
.myqr #qr-body { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; }
.myqr canvas { max-width: min(100%, 320px); height: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
@media (max-width: 900px) { .scan-grid { grid-template-columns: 1fr; } }

.today-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.today-row:last-child { border-bottom: 0; }
.today-row span { color: var(--muted); }

/* ---------- Payroll Officer: preparation, processing, payslips, reports ---------- */
.week-pick { display: flex; gap: 6px; align-items: center; }
.week-pick input { flex: 1; }
.flash-info { background: var(--accent); border-left: 4px solid var(--primary-dark); padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; font-size: 14px; }
.flash-error a { color: inherit; font-weight: 700; }
.neg { color: var(--red); }
.pos { color: var(--green); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.stat .k { display: block; color: var(--muted); font-size: 12px; }
.stat strong { font-size: 20px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tab:hover { color: var(--text-dark); }
.tab.active { color: var(--text-dark); border-bottom-color: var(--primary-dark); }
.tab-panel[hidden] { display: none; }
.cell-input { width: 96px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; text-align: right; background: #fff; }
.cell-input.edited { border-color: var(--primary-dark); background: var(--accent); }
.summary-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.edit-row { display: grid; grid-template-columns: 1fr 120px 28px; gap: 8px; margin-bottom: 8px; align-items: center; }
.edit-row input { padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; width: 100%; }
.total-row td { font-weight: 700; background: var(--bg); }
.holiday-list { list-style: none; margin: 8px 0 14px; padding: 0; max-height: 240px; overflow-y: auto; }
.holiday-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); align-items: center; }
.holiday-add { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.holiday-add .field { margin-bottom: 0; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(59, 42, 26, .45); display: flex; align-items: center; justify-content: center; z-index: 50; }

.slips { display: grid; gap: 18px; }
.slip { position: relative; background: #fff; border: 1px solid var(--text-dark); padding: 14px 16px; break-inside: avoid; }
.slip-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--text-dark); padding-bottom: 8px; margin-bottom: 8px; }
.slip-co { display: grid; align-content: start; gap: 2px; }
.slip-co span { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.slip-meta { display: grid; gap: 2px; font-size: 13px; margin: 0; }
.slip-meta > div { display: flex; gap: 10px; justify-content: space-between; }
.slip-meta dt { color: var(--muted); }
.slip-meta dd { margin: 0; text-align: right; }
.slip-cols-2 { margin-top: 8px; }
.slip-table .num { text-align: right; width: 22%; }
.slip-table tbody td.num { font-variant-numeric: tabular-nums; }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--text-dark); }
.slip-cols .slip-table + .slip-table { border-left: 1px solid var(--text-dark); }
.slip-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.slip-table th { background: var(--accent); text-align: center; padding: 5px; border-bottom: 1px solid var(--text-dark); color: var(--text-dark); }
.slip-table td { padding: 3px 8px; border: 0; }
.slip-table .amt { text-align: right; font-variant-numeric: tabular-nums; }
.slip-table tfoot td { font-weight: 700; border-top: 1px solid var(--text-dark); }
.slip-net { display: flex; justify-content: space-between; align-items: center; margin: 8px 0; padding: 6px 10px; background: var(--accent); font-size: 18px; }
.slip-foot { margin-top: 14px; }
.slip-foot p { font-size: 12px; margin: 4px 0 18px; }
.sign { display: flex; justify-content: space-between; gap: 30px; font-size: 11px; color: var(--muted); }
.sign span { flex: 1; border-top: 1px solid var(--text-dark); padding-top: 3px; text-align: center; }
.sign span:last-child { flex: 0 0 120px; }
.slip-print { display: block; margin: 8px 0 0 auto; }
@media (max-width: 760px) { .slip-cols { grid-template-columns: 1fr; } .slip-cols .slip-table + .slip-table { border-left: 0; border-top: 1px solid var(--text-dark); } }
@media print {
  /* A payslip in its real size: a strip about 190 x 80 mm, three to an A4 page, with a dashed line to cut along. */
  .slips { gap: 0; display: block; }
  .slip { display: grid; grid-template-columns: 1.1fr 1fr .9fr; grid-template-areas: "head head head" "earn ded sum" "earn ded net" "leave leave ytd" "foot foot foot";
          border: 1px dashed #000; margin-bottom: 2mm; padding: 3px 6px; page-break-inside: avoid; font-size: 8.5px; line-height: 1.25; }
  .slip .slip-cols { display: contents; }
  .slip > .slip-head { grid-area: head; flex-wrap: nowrap; align-items: flex-start; padding-bottom: 2px; margin-bottom: 3px; }
  .slip .slip-co strong { font-size: 11px; }
  .slip .slip-co span { font-size: 8px; }
  .slip .slip-meta { grid-template-columns: repeat(3, auto); gap: 0 16px; font-size: 8.5px; }
  .slip .slip-meta > div { gap: 6px; }
  .slip > .slip-cols:not(.slip-cols-2) > .slip-table:nth-child(1) { grid-area: earn; }
  .slip > .slip-cols:not(.slip-cols-2) > .slip-table:nth-child(2) { grid-area: ded; }
  .slip > .slip-summary { grid-area: sum; }
  .slip > .slip-net { grid-area: net; }
  .slip > .slip-cols-2 > .slip-table:nth-child(1) { grid-area: leave; margin-top: 3px; }
  .slip > .slip-cols-2 > .slip-table:nth-child(2) { grid-area: ytd; margin-top: 3px; }
  .slip > .slip-foot { grid-area: foot; }
  .slip .slip-table { font-size: 8.5px; border: 1px solid #000; border-left-width: 0; }
  .slip > .slip-cols:first-of-type > .slip-table:nth-child(1) { border-left-width: 1px; }
  .slip > .slip-summary { border-left-width: 0; }
  .slip > .slip-cols-2 > .slip-table:nth-child(1) { border-left-width: 1px; }
  .slip .slip-table th { padding: 1px 3px; }
  .slip .slip-table td { padding: 0 4px; }
  .slip .slip-net { font-size: 11px; margin: 3px 0 0 -1px; padding: 2px 6px; }
  .slip .slip-foot { margin-top: 2px; }
  .slip .slip-foot p { font-size: 8px; margin: 0 0 8px; }
  .slip .sign { font-size: 8px; }
  .slip:nth-child(3n):not(:last-child) { page-break-after: always; }
  .slip-print { display: none; }
  body.print-one .slip:not(.print-target) { display: none; }
  body.print-one .slip { page-break-after: auto; }
}

/* ---------- Employee Details: label and value side by side, with room between ---------- */
.detail { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.detail:last-of-type { border-bottom: 0; }
.detail .k { flex: 0 0 150px; color: var(--muted); }
.detail span:last-child { text-align: right; overflow-wrap: anywhere; }
.check-line { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 14px; cursor: pointer; }
.check-line input { width: 18px; height: 18px; }

.small { font-size: 12px; line-height: 1.5; }

.reason-form { margin-top: 8px; }
.reason-form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.reason-form input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; }
.reason-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.leave-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.leave-grid label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--muted); }
.leave-grid input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; }

.mat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.mat-card h3 { margin: 0 0 2px; }
.mat-table { width: 100%; margin-top: 8px; }
.mat-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.mat-table .amt { text-align: right; }

.flag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-right: 4px; }
.flag-early { background: #E3F0FB; color: #1F5F99; }
.flag-late  { background: #FFE9D2; color: #B85C00; }
.flag-under { background: #FDE3E0; color: #B3261E; }
.flag-ok    { background: #E6F4EA; color: #1E7B3A; }

.min-wage-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; padding: 10px 12px; background: var(--accent); border-radius: var(--radius); }
.min-wage-row label { font-weight: 600; }

.agency-box { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius); }
.agency-box h4 { margin: 0 0 4px; }
.agency-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.agency-form input { flex: 1; min-width: 140px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; }
.edit-row.has-kind { grid-template-columns: 1fr 130px 120px 28px; }
.edit-row select { padding: 9px 6px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: #fff; }

.slip-hint { display: block; font-size: 11px; color: var(--muted); line-height: 1.2; }
.slip-summary { margin-top: 8px; border: 1px solid var(--text-dark); }
.slip-summary .sum-line td { font-weight: 700; border-top: 1px solid var(--text-dark); }

.totp-steps { margin: 6px 0 10px 18px; padding: 0; }
#totp-qr { max-width: 240px; height: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: block; margin: 8px 0; }

.test-only { max-width: 520px; font-size: 12px; overflow-wrap: anywhere; }
.test-only code { background: var(--accent); padding: 1px 4px; border-radius: 4px; }

/* ---------- calendar with days that can be switched off ---------- */
.dp { position: relative; display: flex; align-items: center; gap: 6px; }
.dp-input { flex: 1; min-width: 150px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: #fff; cursor: pointer; }
.dp-open { border: 1px solid var(--border); background: #fff; border-radius: var(--radius); padding: 8px 10px; cursor: pointer; font-size: 16px; }
.dp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 70; width: 288px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 28px rgba(59, 42, 26, .22); padding: 12px; }
.dp-pop[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head button { border: 0; background: var(--accent); border-radius: 8px; width: 32px; height: 32px; font-size: 18px; cursor: pointer; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dp-dow { font-size: 11px; color: var(--muted); padding: 4px 0; }
.dp-day { border: 0; background: none; height: 34px; border-radius: 8px; cursor: pointer; font: inherit; }
.dp-day:hover:not(:disabled) { background: var(--accent); }
.dp-day.dp-sel { background: var(--primary-dark); color: #fff; font-weight: 700; }
.dp-day:disabled { color: #c9bdb0; cursor: not-allowed; }
.dp-day.dp-closed { background: repeating-linear-gradient(45deg, #f3ece4, #f3ece4 4px, #fff 4px, #fff 8px); text-decoration: line-through; }
.dp-note { font-size: 11px; color: var(--muted); margin: 8px 0 0; min-height: 14px; }

.otd { margin: 0 0 10px; }
.otd > div { padding: 8px 0; border-bottom: 1px solid var(--border); }
.otd dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.otd dd { margin: 2px 0 0; }
.btn-danger { background: #B3261E; color: #fff; border: 0; border-radius: var(--radius); padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
textarea { font: inherit; }

.myqr { text-align: center; }
.myqr canvas { max-width: 260px; height: auto; }

/* ---------- status tracker (concerns) and small tables ---------- */
.badge { background: var(--accent); border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.tracker { display: flex; align-items: center; gap: 0; margin: 8px 0 12px; }
.tracker .step { flex: 1; text-align: center; font-size: 12px; color: var(--muted); position: relative; }
.tracker .step::before { content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 4px; border-radius: 50%; background: #e6d8c8; border: 2px solid #e6d8c8; position: relative; z-index: 1; }
.tracker .step::after { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: #e6d8c8; z-index: 0; }
.tracker .step:first-child::after { display: none; }
.tracker .step.done::before, .tracker .step.current::before { background: var(--primary-dark); border-color: var(--primary-dark); }
.tracker .step.done::after, .tracker .step.current::after { background: var(--primary-dark); }
.tracker .step.current { color: var(--primary-dark); font-weight: 700; }
.small-table { width: 100%; font-size: 13px; }
.small-table td, .small-table th { padding: 6px 8px; }
.concern { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.concern .answer { background: var(--accent); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
