* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f5;
  color: #1e2a24;
}
header {
  background: #1f3d2c;
  color: #f5f0e6;
  padding: 12px 20px;
  text-align: center;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
header h1 { margin: 0; font-size: 18px; }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.logout-btn {
  background: #b3413a;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.logout-btn:hover { background: #d04a42; }

nav { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.tab-btn {
  background: transparent;
  border: 1px solid #d4af6a;
  color: #f5f0e6;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
}
.tab-btn.active { background: #d4af6a; color: #1f3d2c; font-weight: 600; }

main { max-width: 700px; margin: 0 auto; padding: 16px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.hint { color: #556; font-size: 14px; margin-bottom: 10px; }

.video-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
video, canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.status { margin-top: 10px; font-size: 14px; text-align: center; color: #333; }

.result-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: 12px;
  background: #e8f3ec;
  border: 2px solid #1f3d2c;
  text-align: center;
}
.result-card.hidden { display: none; }
.result-card h2 { margin: 0 0 4px; color: #1f3d2c; }
.result-card.already { background: #f3ece0; border-color: #d4af6a; }

.summary-bar {
  margin: 12px 0;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.summary-bar span { font-weight: 600; }
.summary-bar .present { color: #1f7a3f; }
.summary-bar .absent { color: #b3413a; }
.summary-bar .total { color: #1f3d2c; }

form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
form input, form button {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 15px;
}
form button {
  background: #1f3d2c;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
form button:disabled { background: #999; cursor: not-allowed; }

#workerList { list-style: none; padding: 0; margin-top: 8px; }
#workerList li {
  background: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
#workerList button {
  background: #b3413a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.report-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.report-controls input,
.report-controls select,
.report-controls button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}
.report-controls button { background: #1f3d2c; color: #fff; border: none; cursor: pointer; }
.export-btn { background: #2a6041 !important; margin-left: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #1f3d2c; color: #fff; font-weight: 600; white-space: nowrap; }
tr:hover { background: #f9f9f6; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-present { background: #d4edda; color: #155724; }
.badge-absent { background: #f8d7da; color: #721c24; }

@media (max-width: 480px) {
  main { padding: 10px; }
  th, td { padding: 6px 4px; font-size: 12px; }
  .report-controls { flex-direction: column; }
  .export-btn { margin-left: 0; }
  .header-top { flex-direction: column; gap: 8px; }
}
