.nfc-reader-capture {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nfc-stage {
  min-height: 330px;
  border: 2px dashed rgba(6, 95, 70, .25);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(236,253,245,.92), rgba(255,255,255,.96));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  transition: .2s ease;
}
.dark .nfc-stage {
  background: linear-gradient(145deg, rgba(6,78,59,.22), rgba(15,23,42,.78));
  border-color: rgba(52,211,153,.24);
}
.nfc-stage[data-state="ready"] { border-color: rgba(5,150,105,.55); box-shadow: inset 0 0 45px rgba(16,185,129,.08); }
.nfc-stage[data-state="success"] { border-color: rgba(22,163,74,.72); background: linear-gradient(145deg, rgba(220,252,231,.96), rgba(255,255,255,.96)); }
.nfc-stage[data-state="late"] { border-color: rgba(217,119,6,.72); background: linear-gradient(145deg, rgba(254,243,199,.96), rgba(255,255,255,.96)); }
.nfc-stage[data-state="error"] { border-color: rgba(220,38,38,.65); background: linear-gradient(145deg, rgba(254,226,226,.96), rgba(255,255,255,.96)); }
.nfc-stage[data-state="duplicate"] { border-color: rgba(37,99,235,.65); background: linear-gradient(145deg, rgba(219,234,254,.96), rgba(255,255,255,.96)); }
.dark .nfc-stage[data-state="success"],
.dark .nfc-stage[data-state="late"],
.dark .nfc-stage[data-state="error"],
.dark .nfc-stage[data-state="duplicate"] { background: rgba(15,23,42,.88); }

.nfc-reader-icon {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: #065f46;
  color: white;
  box-shadow: 0 16px 35px rgba(6,95,70,.2);
}
.nfc-stage[data-state="ready"] .nfc-reader-icon { animation: nfcPulse 1.8s ease-in-out infinite; }
@keyframes nfcPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 16px 35px rgba(6,95,70,.2); }
  50% { transform: scale(1.05); box-shadow: 0 16px 45px rgba(16,185,129,.38); }
}

.nfc-kpi {
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 16px;
  padding: 14px;
  background: rgba(248,250,252,.82);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dark .nfc-kpi { background: rgba(30,41,59,.65); border-color: rgba(71,85,105,.55); }
.nfc-kpi span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 800; }
.nfc-kpi strong { font-size: 24px; color: #065f46; }
.dark .nfc-kpi strong { color: #6ee7b7; }

.nfc-person-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 12px 32px rgba(15,23,42,.08);
}
.dark .nfc-person-card { background: rgba(30,41,59,.82); border-color: rgba(71,85,105,.55); }
.nfc-status-chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(6,95,70,.1); color: #065f46; font-size: 10px; font-weight: 800; }
.dark .nfc-status-chip { color: #6ee7b7; background: rgba(16,185,129,.12); }


.nfc-searchable-select { position: relative; }
.nfc-select-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 46px; padding: 11px 13px; border: 1px solid rgb(203 213 225);
  border-radius: 12px; background: #fff; color: #334155; font-size: 13px; text-align: left;
}
.dark .nfc-select-trigger { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.nfc-select-trigger:focus { outline: 3px solid rgba(16,185,129,.18); border-color: #10b981; }
.nfc-select-dropdown {
  position: absolute; z-index: 100020; left: 0; right: 0; top: calc(100% + 7px);
  border: 1px solid rgb(203 213 225); border-radius: 16px; background: #fff;
  box-shadow: 0 22px 55px rgba(15,23,42,.22); overflow: hidden;
}
.dark .nfc-select-dropdown { background: #0f172a; border-color: #334155; }
.nfc-select-search-wrap { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid #e2e8f0; }
.dark .nfc-select-search-wrap { border-color: #334155; }
.nfc-select-search { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: #0f172a; }
.dark .nfc-select-search { color: #e2e8f0; }
.nfc-select-options { max-height: 280px; overflow-y: auto; padding: 6px; }
.nfc-select-option { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 11px; border-radius: 10px; text-align: left; }
.nfc-select-option:hover, .nfc-select-option.is-selected { background: rgba(16,185,129,.11); }
.nfc-select-option small { color: #64748b; font-size: 10px; line-height: 1.35; }
.nfc-session-body-lock { overflow: hidden !important; }



/* Layar sesi NFC mandiri, langsung di bawah body. */
.nfc-session-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  overflow: auto;
  background: #f8fafc;
  color: #0f172a;
  isolation: isolate;
}
.nfc-session-overlay.hidden,
.nfc-session-overlay[aria-hidden="true"] {
  display: none !important;
}
.nfc-session-overlay:fullscreen,
.nfc-session-overlay:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #f8fafc;
}
.dark .nfc-session-overlay,
.dark .nfc-session-overlay:fullscreen,
.dark .nfc-session-overlay:-webkit-full-screen {
  background: #020617;
  color: #e2e8f0;
}
.nfc-session-shell {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2vw, 28px);
  gap: clamp(14px, 2vw, 24px);
}
.nfc-session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(14px, 1.8vw, 22px);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 38px rgba(15,23,42,.08);
}
.dark .nfc-session-header {
  background: rgba(15,23,42,.94);
  border-color: rgba(71,85,105,.65);
}
.nfc-session-meta {
  margin-top: 7px;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  line-height: 1.2;
  font-weight: 900;
  color: #065f46;
}
.dark .nfc-session-meta { color: #6ee7b7; }
.nfc-session-tutor {
  margin-top: 5px;
  font-size: clamp(.78rem, 1.3vw, 1rem);
  color: #64748b;
  font-weight: 700;
}
.nfc-session-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.nfc-session-stop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
}
.nfc-session-stop-button:hover { background: #fee2e2; }
.nfc-session-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(390px, 1fr) auto;
  gap: clamp(14px, 2vw, 22px);
}
.nfc-session-stage {
  min-height: min(68vh, 680px);
  width: 100%;
  border-style: solid;
  border-width: 2px;
}
.nfc-session-stage-title {
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  line-height: 1.15;
  font-weight: 900;
  text-align: center;
  color: #0f172a;
}
.dark .nfc-session-stage-title { color: #f8fafc; }
.nfc-session-stage-message {
  max-width: 850px;
  font-size: clamp(.95rem, 1.7vw, 1.3rem);
  line-height: 1.5;
  text-align: center;
  color: #64748b;
}
.nfc-session-stage .nfc-person-card {
  padding: clamp(18px, 2.5vw, 32px);
}
.nfc-session-stage .nfc-person-card p:first-of-type {
  font-size: clamp(1.5rem, 3vw, 2.65rem);
}
.nfc-session-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.nfc-session-kpis .nfc-kpi {
  padding: clamp(12px, 1.8vw, 20px);
  background: rgba(255,255,255,.94);
}
.dark .nfc-session-kpis .nfc-kpi { background: rgba(15,23,42,.94); }
.nfc-session-kpis .nfc-kpi strong {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}
.nfc-session-body-lock {
  overflow: hidden !important;
}
@media (max-width: 820px) {
  .nfc-session-header { flex-direction: column; }
  .nfc-session-header-actions { justify-content: flex-start; width: 100%; }
  .nfc-session-main { grid-template-rows: minmax(350px, 1fr) auto; }
  .nfc-session-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nfc-session-stage { min-height: 55vh; padding: 18px; }
}
