:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f7;
  color: #142033;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }

.app {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.panel {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(30, 45, 70, 0.08);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 60px rgba(20, 32, 51, 0.10);
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 24px;
  align-items: center;
}

.hero-terminal {
  grid-template-columns: minmax(280px, .75fr) minmax(520px, 1.25fr);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  color: #4d6b9a;
  font-size: 12px;
}

h1, h2 { margin: 0; line-height: 1.05; }
h1 { font-size: clamp(38px, 6vw, 76px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
.muted { color: #5e6c80; max-width: 680px; font-size: 18px; }

.identity-card {
  border-radius: 18px;
  background: #f6f8fb;
  padding: 18px;
  display: grid;
  gap: 9px;
}

label { font-weight: 800; }
input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px 16px;
  background: white;
}

.identity-card-large {
  min-height: 170px;
  align-content: center;
}
.person-name-large {
  min-height: 86px;
  border-radius: 20px;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 850;
  letter-spacing: .01em;
  padding: 18px 22px;
}
.identity-card-large label { font-size: 20px; }
small { color: #64748b; }

.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 22px 0;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 850;
  background: #e2e8f0;
  color: #172033;
}
button:hover { filter: brightness(.98); transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.button-link, .admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 850;
}
.admin-link { color: #1e3a8a; background: #dbeafe; }

.action {
  min-height: 170px;
  color: white;
  font-size: clamp(34px, 7vw, 78px);
  letter-spacing: .035em;
  box-shadow: 0 18px 42px rgba(20, 32, 51, .16);
}
.arrival { background: linear-gradient(135deg, #159957, #1db954); }
.departure { background: linear-gradient(135deg, #d53369, #da7b2b); }
.primary { background: #2563eb; color: white; }
.secondary { background: #dbeafe; color: #1e3a8a; }
.ghost { background: transparent; border: 1px solid #cbd5e1; }
.danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.danger-zone { margin-top: 22px; border-color: #fecaca; }
.admin-hero { margin-bottom: 22px; }
.admin-actions-card {
  border-radius: 18px;
  background: #f6f8fb;
  padding: 18px;
  display: grid;
  gap: 12px;
}
.delete-confirm-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.hidden { display: none !important; }

.camera-panel { margin-bottom: 22px; }
.camera-header, .table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

#cameraPreview, .photo-preview img {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  background: #0f172a;
  border-radius: 18px;
}
.camera-controls, .toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.camera-controls button { flex: 1; min-width: 150px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: middle; }
th { color: #475569; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
td img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid #cbd5e1; }
.empty { color: #64748b; text-align: center; padding: 18px; }

@media (max-width: 760px) {
  .hero, .actions { grid-template-columns: 1fr; }
  .action { min-height: 132px; }
  .camera-header, .table-toolbar { flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions button { flex: 1; }
  .delete-confirm-row { grid-template-columns: 1fr; }
}
