:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1a2233;
  --muted: #6b7689;
  --brand: #2f6df6;
  --brand-dark: #1f54d6;
  --good: #18a957;
  --line: #e3e8f1;
  --shadow: 0 6px 20px rgba(20, 35, 70, 0.08);
}

* { 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(--ink);
  line-height: 1.5;
}

.topbar {
  display: flex; align-items: baseline; gap: 14px;
  padding: 16px 22px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 22px; font-weight: 800; }
.tagline { color: var(--muted); font-size: 14px; }

.steps {
  display: flex; gap: 8px; flex-wrap: wrap;
  max-width: 920px; margin: 18px auto 0; padding: 0 16px;
}
.step-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600;
}
.step-pill .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--muted); font-size: 12px;
}
.step-pill.active { border-color: var(--brand); color: var(--brand); }
.step-pill.active .num { background: var(--brand); color: #fff; }
.step-pill.done .num { background: var(--good); color: #fff; }

main { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; }

.screen { display: none; }
.screen.active { display: block; }

h1 { font-size: 28px; margin: 6px 0 4px; }
h2 { font-size: 20px; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; box-shadow: var(--shadow);
}
.card.center { text-align: center; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.field small { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="file"], select {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe;
}
input[type="text"]:focus, select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.roster-row { display: grid; grid-template-columns: 1fr 120px 44px; gap: 8px; margin-bottom: 8px; }
.roster-row button { border: none; background: #fde8e8; color: #c0392b; border-radius: 8px; cursor: pointer; font-size: 18px; }

.or { text-align: center; color: var(--muted); margin: 12px 0; font-size: 14px; }

.btn-primary {
  background: var(--brand); color: #fff; border: none;
  padding: 14px 22px; border-radius: 12px; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary.big { width: 100%; font-size: 18px; padding: 16px; margin-top: 8px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  padding: 10px 18px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-ghost:hover { background: var(--bg); }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; }

.progress-wrap { margin: 18px 0 4px; }
.progress-bar { background: var(--line); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-bar.tall { height: 18px; }
.progress-fill { background: linear-gradient(90deg, var(--brand), #5b8cff); height: 100%; width: 0%; transition: width .4s; }
.progress-label { font-size: 13px; color: var(--muted); margin-top: 6px; }

.big-progress { margin: 8px 0 24px; }
.percent { font-size: 40px; font-weight: 800; margin-top: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 10px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }
.stat { background: var(--bg); border-radius: 12px; padding: 16px; }
.stat-num { font-size: 26px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--muted); }
.status-msg { margin-top: 18px; color: var(--muted); }

.error { color: #c0392b; background: #fdecea; border: 1px solid #f5c6c0; padding: 12px 14px; border-radius: 10px; margin-top: 14px; }
.hidden { display: none !important; }

/* identity cards */
.identity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.id-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.id-color { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; margin-right: 6px; }
.id-crops { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; }
.id-crops img { height: 90px; border-radius: 8px; border: 1px solid var(--line); }
.id-stats { font-size: 13px; color: var(--muted); margin: 8px 0; }
.id-stats span { display: inline-block; background: var(--bg); border-radius: 6px; padding: 2px 8px; margin: 2px 4px 2px 0; }
.id-inputs { display: grid; grid-template-columns: 1fr 70px; gap: 8px; }

/* report */
.report-section { margin-bottom: 30px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: var(--bg); font-weight: 700; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }

.hl-cat { margin-bottom: 22px; }
.hl-cat h3 { font-size: 17px; margin: 0 0 10px; text-transform: capitalize; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.hl-clip { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.hl-clip video { width: 100%; display: block; background: #000; }
.hl-meta { padding: 8px 12px; font-size: 13px; color: var(--muted); }
.hl-noclip { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 14px; font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }
