* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

a {
  color: inherit;
}

code {
  background: #eef2f7;
  padding: 2px 5px;
  border-radius: 5px;
}

.topbar {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #111827;
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar nav a {
  color: white;
  text-decoration: none;
  font-size: 14px;
}

.muted-light {
  color: #cbd5e1;
}

.container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: white;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .06);
}

.narrow {
  max-width: 430px;
  margin: 50px auto;
}

.app-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: #eef2ff;
  border-radius: 16px;
}

.hero {
  text-align: center;
}

.hero h1 {
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  background: #eef2ff;
  border-radius: 999px;
  font-size: 13px;
}

.muted {
  color: #6b7280;
}

.clock {
  font-size: 44px;
  font-weight: 800;
  margin: 18px 0 6px;
  letter-spacing: 1px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  text-decoration: none;
  cursor: pointer;
  background: #e5e7eb;
  font-weight: 700;
}

.btn.primary {
  background: #111827;
  color: white;
}

.btn.secondary {
  background: #e0e7ff;
  color: #3730a3;
}

.btn.success {
  background: #16a34a;
  color: white;
  font-size: 18px;
}

.btn.danger {
  background: #dc2626;
  color: white;
  font-size: 18px;
}

.btn.small {
  padding: 7px 10px;
  font-size: 12px;
}

.btn.full,
.full {
  width: 100%;
}

.statusbox {
  padding: 12px;
  border-radius: 12px;
  background: #f3f4f6;
  margin-top: 12px;
}

.statusbox.ok {
  background: #dcfce7;
  color: #166534;
}

.statusbox.bad {
  background: #fee2e2;
  color: #991b1b;
}

.statusbox.warn {
  background: #fef3c7;
  color: #92400e;
}

.gps-panel {
  background: #f9fafb;
  padding: 12px 14px;
  border-radius: 14px;
  margin: 14px 0;
}

.gps-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid2 > div {
  padding: 14px;
  border-radius: 14px;
  background: #f9fafb;
}

.grid2 span,
.grid2 strong {
  display: block;
}

.grid2 strong {
  font-size: 24px;
  margin-top: 6px;
}

label {
  display: block;
  font-weight: 700;
  margin: 12px 0 6px;
}

input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
}

form .btn {
  margin-top: 14px;
}

.demo,
.note {
  margin-top: 16px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 12px;
  font-size: 14px;
}

.alert {
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.alert.success {
  background: #dcfce7;
}

.alert.danger {
  background: #fee2e2;
}

.alert.warning {
  background: #fef3c7;
  color: #92400e;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 13px;
  color: #6b7280;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .05);
}

.stat span {
  display: block;
  color: #6b7280;
}

.stat b {
  font-size: 30px;
}

.admin-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.page-title h1 {
  margin-bottom: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-action {
  display: flex;
  align-items: end;
}

.wide {
  grid-column: 1 / -1;
}

.connect-grid {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 20px;
  align-items: center;
}

.url-box {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  padding: 13px;
  border-radius: 12px;
  background: #111827;
  color: white;
  overflow-wrap: anywhere;
}

.qr-wrap {
  text-align: center;
}

.qr {
  width: 170px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

@media (max-width: 720px) {
  .actions,
  .grid2,
  .form-grid,
  .connect-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .topbar,
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .clock {
    font-size: 38px;
  }

  .qr-wrap {
    display: none;
  }
}


select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: white;
}

.feature-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}
.feature-badges span {
  background: #f3f4f6;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}

.selfie-thumb {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 10px;
  border: 2px solid white;
  box-shadow: 0 3px 12px rgba(0,0,0,.12);
}

.table-selfie {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.photo-pair {
  display: flex;
  gap: 5px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,.72);
  padding: 18px;
  align-items: center;
  justify-content: center;
}
.modal.show {
  display: flex;
}
.modal-card {
  width: min(480px, 100%);
  background: white;
  border-radius: 20px;
  padding: 18px;
}
#cameraVideo {
  width: 100%;
  max-height: 62vh;
  object-fit: cover;
  border-radius: 16px;
  background: #111827;
  transform: scaleX(-1);
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 12px;
}

.option-box {
  background: #f9fafb;
  border-radius: 14px;
  padding: 12px;
}
.checkline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 4px;
}
.checkline input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}
.checkline small {
  color: #6b7280;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 12px;
  white-space: nowrap;
}
.ok-pill,
.status-approved {
  background: #dcfce7;
  color: #166534;
}
.status-pending {
  background: #fef3c7;
  color: #92400e;
}
.status-rejected {
  background: #fee2e2;
  color: #991b1b;
}
.inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.danger-soft {
  background: #fee2e2;
  color: #991b1b;
}
.approve {
  background: #dcfce7;
  color: #166534;
}
.decision-form {
  margin: 4px 0;
  display: flex;
  gap: 6px;
  align-items: center;
}
.decision-form input {
  min-width: 150px;
  padding: 7px 9px;
  font-size: 13px;
}
.mini-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: -4px 0 18px;
}
.mini-stats > div {
  background: white;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}
.report-filter {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 12px;
  align-items: end;
}

@media (max-width: 720px) {
  .modal-actions,
  .report-filter {
    grid-template-columns: 1fr;
  }
  .decision-form {
    align-items: stretch;
    flex-direction: column;
  }
}

.url-secondary { margin-top: 10px; background: #374151; font-size: 13px; }
details { margin-top: 12px; }
summary { cursor: pointer; color: #6b7280; font-weight: 600; }
