:root {
  --gold: #d5a745;
  --ink: #101316;
  --paper: #f5f2ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 16px system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

header {
  height: 80px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 12px 4vw;
  gap: 20px;
  border-bottom: 1px solid #ddd;
}

header img,
.khead img {
  width: 90px;
  height: 52px;
  object-fit: contain;
}

header h1 {
  flex: 1;
}

a {
  color: #8b671c;
}

main {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.locations {
  display: flex;
  gap: 12px;
}

.locations a,
button {
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 13px 18px;
  text-decoration: none;
}

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.people article {
  background: white;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
}

.people img {
  width: 82px;
}

.people small,
.people strong {
  display: block;
}

.table {
  overflow: auto;
}

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

td,
th {
  padding: 11px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.entrada {
  color: #16824b;
}

.salida {
  color: #bd4b36;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.panel {
  width: min(380px, 90vw);
  background: white;
  padding: 36px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 15px 60px #0002;
}

.panel img {
  width: 170px;
}

.panel input {
  width: 100%;
  padding: 14px;
  margin: 15px 0;
  border: 1px solid #bbb;
  border-radius: 9px;
}

.error {
  display: block;
  color: #b33;
  margin-bottom: 10px;
}

.cardpage {
  text-align: center;
  padding: 30px;
}

.badge {
  width: 340px;
  margin: auto;
  background: white;
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 25px;
}

.badge .brand {
  width: 150px;
}

.badge .qr {
  width: 260px;
}

.badge small {
  display: block;
}

.cardpage button {
  margin: 20px;
}

.location-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #252a2e, #0d1012 65%);
  color: white;
}

.location-panel {
  width: min(760px, 94vw);
  text-align: center;
  margin: 0;
}

.location-panel > img {
  width: 180px;
  background: white;
  border-radius: 14px;
  padding: 8px;
}

.location-panel .eyebrow {
  color: var(--gold);
  letter-spacing: 3px;
  font-size: 12px;
  font-weight: 800;
}

.location-panel h1 {
  font-size: 42px;
  margin: 8px;
}

.location-panel > p {
  color: #b7bec2;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 35px;
}

.location-grid button {
  text-align: left;
  padding: 28px;
  border: 1px solid #ffffff22;
  background: #ffffff0c;
  cursor: pointer;
}

.location-grid button:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.location-grid span,
.location-grid strong,
.location-grid i {
  display: block;
}

.location-grid span {
  color: #aab2b7;
}

.location-grid strong {
  font-size: 30px;
  margin: 8px 0;
  color: var(--gold);
}

.location-grid i {
  font-style: normal;
}

.kiosk {
  background: #0d1012;
  color: white;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.khead {
  min-height: 92px;
  display: flex;
  align-items: center;
  padding: 14px 4vw;
  gap: 16px;
  background: #15191c;
  position: sticky;
  top: 0;
  z-index: 20;
}

.khead div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.khead span {
  color: var(--gold);
}

.khead time {
  font-size: 32px;
  font-weight: 700;
  white-space: nowrap;
}

.kadmin,
.fullscreen-toggle {
  white-space: nowrap;
}

.fullscreen-toggle {
  background: #24303a !important;
}

.scan {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 20px auto;
  padding: 0 4vw 28px;
  position: relative;
  max-width: 1200px;
  min-height: calc(100dvh - 112px);
}

.scan-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-start;
  padding-top: 8px;
}

.scan-copy .eyebrow {
  color: var(--gold);
  letter-spacing: 3px;
  font-size: 12px;
  font-weight: 800;
  margin: 0;
}

.scan h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1;
}

.scan p {
  color: #adb5ba;
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.5;
  max-width: 30rem;
}

.scan-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-panel {
  position: relative;
  min-width: 0;
}

.scan #reader {
  width: 100%;
  border: 0 !important;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 2px #ffffff22;
  min-height: 58vh;
}

.scan #reader video {
  object-fit: cover;
}

.change-location {
  padding: 12px 16px;
  background: transparent;
  color: #d0d5d8;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #ffffff22;
  border-radius: 10px;
}

.scanline {
  position: absolute;
  top: 12%;
  left: 18%;
  right: 18%;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: scan 2.2s ease-in-out infinite;
  pointer-events: none;
}

.result {
  position: fixed;
  inset: 0;
  background: #07110fef;
  display: grid;
  place-items: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
}

.result.show {
  opacity: 1;
}

.result.bad {
  background: #1c0909f2;
}

.result i {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  margin: auto;
  border: 4px solid #42d58b;
  border-radius: 50%;
  font-size: 70px;
  font-style: normal;
}

.result-greeting {
  margin: 18px 0 8px;
  color: #d9e7dd;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.result.bad i {
  border-color: #ef6b62;
}

.result h2 {
  font-size: 38px;
  margin: 20px;
}

.result strong {
  font-size: 28px;
  color: #42d58b;
}

.result.bad strong {
  color: #ef6b62;
}

@media (max-width: 900px) {
  .scan {
    grid-template-columns: 1fr;
    min-height: auto;
    align-items: start;
  }

  .scan #reader {
    min-height: 52vh;
  }

  .khead {
    gap: 10px;
  }

  .khead time {
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  .khead {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
  }

  .khead img {
    width: 76px;
    height: 44px;
  }

  .khead time {
    order: 4;
    width: 100%;
    text-align: right;
  }

  .scan {
    padding: 0 16px 22px;
    min-height: auto;
  }

  .scan #reader {
    min-height: 48vh;
    border-radius: 18px;
  }

  .location-panel h1 {
    font-size: 32px;
  }

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

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

  .people article {
    grid-template-columns: 1fr 72px;
  }

  .people img {
    width: 72px;
  }
}

@media print {
  .cardpage > button {
    display: none;
  }
}
