* { box-sizing: border-box; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: #0f1f33;
  color: #1a1a1a;
  margin: 0;
  min-height: 100vh;
}
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}
.wrap.wide {
  max-width: 1100px;
}
.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}
h1 {
  color: #ffffff;
  font-size: 22px;
  margin: 0 0 4px;
}
h2 {
  font-size: 18px;
  margin: 0 0 12px;
  color: #1F4E78;
}
.subtitle {
  color: #c7d3e0;
  font-size: 14px;
  margin: 0 0 20px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #444;
  margin-bottom: 6px;
  margin-top: 14px;
}
input[type=text], input[type=number], input[type=password], select {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  border: 2px solid #ccc;
  border-radius: 8px;
}
input:focus, select:focus {
  outline: none;
  border-color: #1F4E78;
}
button {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background: #1F4E78;
  color: #fff;
  margin-top: 16px;
  cursor: pointer;
}
button:active { background: #163a5c; }
button.secondary {
  background: #eee;
  color: #333;
}
button.small {
  width: auto;
  padding: 8px 14px;
  font-size: 14px;
  margin: 0;
}
.role-toggle {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.role-toggle button {
  margin-top: 0;
  background: #eee;
  color: #333;
}
.role-toggle button.active {
  background: #1F4E78;
  color: #fff;
}
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}
.pill.a { background: #d9e1f2; color: #1F4E78; }
.pill.b { background: #fce4d6; color: #9c5700; }
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 13px;
  margin-bottom: 10px;
}
.status-bar a { color: #9fc0e8; text-decoration: underline; cursor: pointer; }
.item-result {
  background: #f4f8fb;
  border: 2px solid #1F4E78;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}
.item-result .desc { font-size: 18px; font-weight: bold; margin-bottom: 4px; }
.item-result .code { font-size: 13px; color: #666; margin-bottom: 10px; }
.error-box {
  background: #fde8e8;
  border: 2px solid #c00;
  color: #900;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}
.recent-list { list-style: none; padding: 0; margin: 10px 0 0; }
.recent-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
th, td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}
th {
  background: #1F4E78;
  color: #fff;
  position: sticky;
  top: 0;
}
tr.match { background: #eaf7ea; }
tr.mismatch { background: #fdeaea; }
tr.notcounted { background: #fafafa; color: #999; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-box {
  background: #f4f8fb;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-box .num { font-size: 26px; font-weight: bold; color: #1F4E78; }
.stat-box .label { font-size: 12px; color: #666; }
.table-scroll { max-height: 65vh; overflow: auto; border: 1px solid #ddd; border-radius: 8px; }
.filters { margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; padding: 8px; font-size: 14px; }
#reader { width: 100%; margin-top: 12px; }
