:root {
  --primary: #007a65;
  --primary-dark: #00594a;
  --accent: #f5820d;
  --accent-dark: #d96c00;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --bg: #f1f6f4;
  --card: #ffffff;
  --text: #14212e;
  --muted: #5b6b7c;
  --line: #d7e5e1;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 90, 75, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
a { color: var(--primary); }
img { max-width: 100%; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap-wide { max-width: 1100px; }

.topbar {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  border-bottom: 3px solid var(--accent);
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.topbar img { height: 34px; background: #fff; border-radius: 8px; padding: 3px 6px; }
.topbar .t { font-weight: 700; font-size: 1rem; }
.topbar .s { font-size: .78rem; opacity: .9; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 14px 18px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  background: var(--primary); color: #fff; width: 100%;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #e6efec; color: var(--primary-dark); }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-dark); filter: none; }
.btn.danger { background: var(--err); }
.btn.small { padding: 9px 12px; width: auto; font-size: .9rem; }

input[type=text], input[type=password], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 13px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }

.muted { color: var(--muted); font-size: .88rem; }
.center { text-align: center; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

.alert { padding: 12px 14px; border-radius: 12px; font-size: .92rem; margin-top: 12px; }
.alert.ok { background: #e7f7ec; color: #14652f; }
.alert.warn { background: #fdf3e3; color: #8a5300; }
.alert.err { background: #fdeaea; color: #9b1c1c; }
.alert.info { background: #e8f2fb; color: #0b4a7a; }
.hidden { display: none !important; }

/* Scanner */
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; min-height: 240px; }
#reader video { width: 100% !important; }

/* Kuesioner */
.progress { height: 9px; background: #dfebe7; border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .25s; }
.steplabel { font-size: .82rem; color: var(--muted); }
.section-title { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.q-title { font-size: 1.32rem; font-weight: 800; line-height: 1.3; margin: 10px 0 14px; color: var(--text); }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; background: #fff; font-size: .9rem; font-weight: 500; color: var(--muted);
}
.opt:hover { border-color: var(--primary); }
.opt.skip { border-style: dashed; background: #fafafa; }
.opt.skip.sel { border-style: solid; background: #f1f3f5; color: var(--muted); box-shadow: none; }
.opt.skip.sel .dot { border-color: var(--muted); background: radial-gradient(circle, var(--muted) 45%, #fff 46%); }
.q-hint { font-size: .82rem; color: var(--muted); margin: -6px 0 12px; font-style: italic; }
.opt.sel { border-color: var(--primary); background: #e6f2ef; color: var(--primary-dark); box-shadow: 0 0 0 2px rgba(0,122,101,.18) inset; font-weight: 700; }
.opt .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.opt.sel .dot { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 45%, #fff 46%); }
.opt .ini { margin-left: auto; font-size: .72rem; color: var(--muted); font-weight: 700; }

kbd { background: #eaf2f0; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font-size: .85em; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f2f7f5; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat .n { font-size: 1.7rem; font-weight: 800; color: var(--primary-dark); }
.stat .l { font-size: .82rem; color: var(--muted); }
.bar { height: 8px; background: #dfebe7; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

@media (max-width: 520px) {
  .wrap { padding: 12px; }
  .card { padding: 16px; }
}
