:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1a1f24;
  --muted: #5f6b76;
  --line: #dde3e8;
  --primary: #0b6e4f;
  --primary-dark: #08563d;
  --danger: #b42318;
  --warn-bg: #fff4e5;
  --warn-text: #7a3e00;
  --ok-bg: #e6f6ee;
  --ok-text: #0b6e4f;
  --err-bg: #fdecea;
  --err-text: #b42318;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
header.top {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}
header.top .brand { font-weight: 700; font-size: 17px; }
header.top nav { display: flex; gap: 6px; align-items: center; }
header.top nav a, header.top nav button {
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.15);
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
header.top nav a.active { background: rgba(255,255,255,0.35); font-weight: 600; }
header.top .who { font-size: 13px; opacity: 0.9; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }

label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=search] {
  width: 100%;
  font-size: 17px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  padding: 16px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  background: var(--primary);
  color: #fff;
  touch-action: manipulation;
}
.btn:active { background: var(--primary-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.secondary { background: #e9edf1; color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.small { width: auto; font-size: 14px; padding: 8px 12px; font-weight: 500; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.mt { margin-top: 12px; }

.notice { padding: 12px; border-radius: 8px; font-size: 15px; margin-bottom: 12px; }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.err { background: var(--err-bg); color: var(--err-text); }

/* Scanner */
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; min-height: 240px; }
#reader video { border-radius: 12px; }
#reader img[alt="Info icon"], #reader img[alt="Camera based scan"] { display: none; }
.scan-hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 8px; }

.emp { text-align: center; }
.emp .id { font-size: 15px; color: var(--muted); letter-spacing: 0.5px; }
.emp .name { font-size: 28px; font-weight: 700; margin: 6px 0; word-break: break-word; }
.emp .dept { font-size: 17px; color: var(--muted); }
.emp .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.emp .btn { margin-top: 18px; }
.big-ok { font-size: 48px; line-height: 1; margin: 6px 0; }

/* Report */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin: 12px 0; }
.tabs button {
  flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-family: inherit; font-size: 15px; cursor: pointer; color: var(--text);
}
.tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
td .nm { font-weight: 600; }
td .sm { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.yes { background: var(--ok-bg); color: var(--ok-text); }
.pill.no { background: #eef1f4; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--primary); font-family: inherit; font-size: 13px; padding: 0; cursor: pointer; text-decoration: underline; }
.table-wrap { overflow-x: auto; }
.hidden { display: none !important; }
details summary { cursor: pointer; font-weight: 600; }
.by-user { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.by-user span { background: #eef1f4; border-radius: 6px; padding: 4px 8px; font-size: 13px; }
input[type=file] { font-size: 14px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0; }
