.teacher-open-student-scan {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  background: linear-gradient(135deg, #0f766e, #059669);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 20px #0596692e;
  cursor: pointer;
}

/* Tombol ini adalah tab keempat, bukan kartu ikon. Ukurannya mengikuti
   Absen Harian, Riwayat Sesi, dan Rekapitulasi. */
#root .teacher-open-student-scan {
  height: auto !important;
  min-height: 48px !important;
  min-width: 128px !important;
  padding: 10px 16px !important;
  gap: 7px !important;
}

#root .teacher-open-student-scan > .teacher-scan-tab-icon {
  display: block !important;
  flex: 0 0 16px !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  max-height: 16px !important;
  fill: none !important;
  stroke: currentColor !important;
}
.teacher-student-scan-modal {
  position: fixed;
  inset: 0;
  z-index: 560;
  background: #020617c7;
  backdrop-filter: blur(12px);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.teacher-student-scan-dialog {
  width: min(980px, 100%);
  max-height: calc(100dvh - 36px);
  background: #f8fafc;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 35px 110px #0008;
  display: flex;
  flex-direction: column;
}
.teacher-student-scan-dialog > header {
  position: static;
  height: auto;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.teacher-student-scan-dialog > header small {
  display: block;
  color: #059669;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.teacher-student-scan-dialog > header h2 {
  font-size: 21px;
  line-height: 1.2;
  margin: 3px 0 0;
  color: #0f172a;
}
.teacher-student-scan-dialog > header p {
  font-size: 11px;
  margin: 3px 0 0;
  color: #64748b;
}
.teacher-student-scan-dialog > header button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 25px;
  cursor: pointer;
}
.teacher-student-scan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
  min-height: 0;
  overflow: hidden;
}
.teacher-student-scan-view {
  position: relative;
  padding: 18px;
  background: #020617;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.teacher-student-scan-view #teacher-student-scan-camera {
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  aspect-ratio: 1;
}
.teacher-student-scan-view #teacher-student-scan-camera video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 20px;
}
.teacher-student-scan-view #teacher-student-scan-camera img {
  display: none !important;
}
.teacher-student-scan-guide {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(280px, 80%);
  height: min(280px, 80%);
  transform: translate(-50%, -50%);
}
.teacher-student-scan-guide span {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #34d399;
}
.teacher-student-scan-guide span:nth-child(1) {
  left: 0;
  top: 0;
  border-left: 4px solid;
  border-top: 4px solid;
  border-radius: 10px 0 0;
}
.teacher-student-scan-guide span:nth-child(2) {
  right: 0;
  top: 0;
  border-right: 4px solid;
  border-top: 4px solid;
  border-radius: 0 10px 0 0;
}
.teacher-student-scan-guide span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 4px solid;
  border-bottom: 4px solid;
  border-radius: 0 0 10px;
}
.teacher-student-scan-guide span:nth-child(4) {
  left: 0;
  bottom: 0;
  border-left: 4px solid;
  border-bottom: 4px solid;
  border-radius: 0 0 0 10px;
}
.teacher-student-scan-status {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
}
.teacher-student-scan-status[data-type="ready"] {
  color: #6ee7b7;
}
.teacher-student-scan-status[data-type="loading"] {
  color: #fde68a;
}
.teacher-student-scan-status[data-type="error"] {
  color: #fca5a5;
}
.teacher-student-scan-retry {
  display: block;
  margin: 10px auto 0;
  border: 0;
  border-radius: 12px;
  background: #10b981;
  color: #fff;
  padding: 10px 16px;
  font: 800 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 22px #10b98140;
}
.teacher-student-scan-retry[hidden] {
  display: none !important;
}
.teacher-student-scan-toast {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
  width: min(390px, calc(100% - 40px));
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 20px 60px #0006;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: teacher-scan-pop 0.24s ease-out;
}
.teacher-student-scan-toast[data-type="duplicate"] {
  background: #fffbeb;
  border-color: #fcd34d;
}
.teacher-student-scan-toast[data-type="error"] {
  background: #fef2f2;
  border-color: #fca5a5;
}
.teacher-scan-toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  flex: none;
}
.teacher-student-scan-toast[data-type="duplicate"] .teacher-scan-toast-icon {
  background: #f59e0b;
}
.teacher-student-scan-toast[data-type="error"] .teacher-scan-toast-icon {
  background: #ef4444;
}
.teacher-student-scan-toast b,
.teacher-student-scan-toast strong,
.teacher-student-scan-toast span {
  display: block;
}
.teacher-student-scan-toast b {
  font-size: 10px;
  color: #047857;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.teacher-student-scan-toast strong {
  font-size: 15px;
  color: #0f172a;
  margin-top: 2px;
}
.teacher-student-scan-toast span {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}
.teacher-student-scan-grid > aside {
  min-height: 0;
  background: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.teacher-student-scan-today-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 13px;
}
.teacher-student-scan-today-head small {
  font-size: 8px;
  color: #059669;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.teacher-student-scan-today-head h3 {
  font-size: 15px;
  margin: 2px 0 0;
  color: #0f172a;
}
.teacher-student-scan-today-head > b {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #ecfdf5;
  color: #059669;
  display: grid;
  place-items: center;
  font-size: 17px;
}
.teacher-student-scan-grid aside ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  overflow-y: auto;
  min-height: 0;
}
.teacher-student-scan-grid aside li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px solid #f1f5f9;
}
.teacher-student-scan-grid aside li > span {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #ecfdf5;
  color: #059669;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
}
.teacher-student-scan-grid aside li b,
.teacher-student-scan-grid aside li small {
  display: block;
}
.teacher-student-scan-grid aside li b {
  font-size: 11px;
  color: #0f172a;
}
.teacher-student-scan-grid aside li small {
  font-size: 8px;
  color: #64748b;
  margin-top: 2px;
}
.teacher-student-scan-grid aside li time {
  font-size: 9px;
  color: #059669;
  font-weight: 900;
}
.teacher-student-scan-grid aside li.teacher-scan-empty {
  display: block;
  text-align: center;
  padding: 35px 10px;
  color: #94a3b8;
  font-size: 11px;
  border: 0;
}
@keyframes teacher-scan-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
@media (max-width: 760px) {
  .teacher-student-scan-modal {
    padding: 0;
    align-items: stretch;
  }
  .teacher-student-scan-dialog {
    max-height: none;
    height: 100dvh;
    border-radius: 0;
  }
  .teacher-student-scan-dialog > header {
    padding: 14px 16px;
  }
  .teacher-student-scan-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(330px, 55dvh) minmax(0, 1fr);
    overflow-y: hidden;
  }
  .teacher-student-scan-view {
    min-height: 0;
    padding: 10px;
  }
  .teacher-student-scan-view #teacher-student-scan-camera video {
    max-height: 41dvh;
  }
  .teacher-student-scan-grid > aside {
    padding: 13px 16px;
    overflow: hidden;
  }
  .teacher-student-scan-guide {
    width: min(280px, 80%);
    height: min(280px, 80%);
  }
  .teacher-open-student-scan {
    min-height: 45px !important;
    min-width: 118px !important;
    padding: 9px 13px !important;
    font-size: 11px !important;
  }
}
