.registeredGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.registeredFace {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e4eaed;
  border-radius: 10px;
  background: #fbfcfc;
}

.registeredFace.isEnrolled {
  border-color: #cfeadf;
  background: linear-gradient(135deg, #f8fffb, #f2fbf7);
}

.registeredFace.notEnrolled { background: #fafbfb; }

.registeredPhoto {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #102b37;
  color: #fff;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  font-weight: 900;
  font-size: 17px;
}

.registeredPhoto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.registeredPhoto i {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #16a66f;
  color: #fff;
  border: 2px solid #fff;
  font-style: normal;
  font-size: 8px;
}

.notEnrolled .registeredPhoto {
  background: #dfe6e9;
  color: #6f7e87;
}

.notEnrolled .registeredPhoto i { background: #8a98a0; }
.registeredInfo { min-width: 0; }

.registeredInfo b {
  display: block;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registeredInfo small {
  display: block;
  color: #81909a;
  font-size: 7px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registeredInfo em {
  display: block;
  color: #11855d;
  font-style: normal;
  font-size: 6px;
  font-weight: 900;
  margin-top: 5px;
  letter-spacing: .025em;
}

.notEnrolled .registeredInfo em { color: #8a6b1e; }
.empPhoto { overflow: hidden; }
.empPhoto img { width: 100%; height: 100%; object-fit: cover; }
.quality b { min-width: 48px; display: inline-block; }
.quality b:not(:empty) { transition: color .2s ease; }

@media (max-width: 1100px) {
  .registeredGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .registeredGrid { grid-template-columns: 1fr; }
  .registeredFace { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .registeredPhoto { width: 46px; height: 46px; }
  .registeredPanel .ph { align-items: flex-start; gap: 8px; }
  .registeredPanel .ph button { white-space: nowrap; }
}

.event {
  grid-template-columns: 54px minmax(140px, 1fr) minmax(160px, auto);
  align-items: center;
  border-radius: 8px;
  padding: 10px 8px;
}

.event.isAdjusted {
  background: #fff9ea;
  border: 1px solid #f5e1aa;
  margin: 3px 0;
}

.eventType {
  width: 42px;
  padding: 6px 5px;
  border-radius: 6px;
  text-align: center;
  background: #e6f8f0;
  color: #11835c !important;
}

.eventType.out {
  background: #eaf0fa;
  color: #315d9d !important;
}

.eventPerson b,
.eventTime b { display: block; font-size: 9px; }

.eventPerson small,
.eventTime small {
  display: block;
  color: #8b98a1;
  font-size: 7px;
  margin-top: 3px;
}

.eventTime { text-align: right; }
.eventTime small { color: #9a7014; font-weight: 900; }

.editPunch {
  border: 1px solid #dbe6e2;
  background: #fff;
  color: #11835c;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 7px;
  font-weight: 900;
  white-space: nowrap;
}

.editPunch:hover { background: #eaf8f2; }
.punchEditCard { width: min(680px, 100%); }

.punchEmployee {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: #f5f9f7;
  border: 1px solid #e1ebe7;
}

.punchEmployee b { display: block; font-size: 10px; }
.punchEmployee small { display: block; color: #7e8c95; font-size: 8px; margin-top: 3px; }

.adjustedBadge {
  padding: 5px 7px;
  border-radius: 6px;
  background: #fff0c8;
  color: #946800;
  font-size: 6px;
  font-weight: 900;
}

.reasonLabel {
  display: block;
  margin-top: 13px;
  font-size: 8px;
  font-weight: 900;
}

.reasonLabel textarea {
  width: 100%;
  resize: vertical;
  margin-top: 5px;
  padding: 10px;
  border: 1px solid #dfe6e9;
  border-radius: 8px;
  outline: 0;
  font: inherit;
  font-size: 9px;
}

.reasonLabel textarea:focus { border-color: #36b887; box-shadow: 0 0 0 3px #25aa7a18; }

.auditNotice {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #f6f8f9;
  color: #71808a;
}

.auditNotice b { color: #14845f; font-size: 8px; white-space: nowrap; }
.auditNotice span { font-size: 7px; line-height: 1.4; }

.accessResultIcon.hasPhoto {
  width: 110px;
  height: 110px;
  overflow: hidden;
  background: #fff;
}

.accessResultIcon.hasPhoto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.accessResultCard.withEmployeePhoto {
  display: grid;
  grid-template-columns: 120px minmax(260px, 1fr);
  column-gap: 24px;
  text-align: left;
  align-items: center;
}

.accessResultCard.withEmployeePhoto .accessResultIcon {
  grid-column: 1;
  grid-row: 1 / 5;
  margin: 0;
}

.accessResultCard.withEmployeePhoto > strong,
.accessResultCard.withEmployeePhoto > b,
.accessResultCard.withEmployeePhoto > span,
.accessResultCard.withEmployeePhoto > time { grid-column: 2; }

.accessResultCard.withEmployeePhoto > b { margin-top: 8px; }
.accessResultCard.withEmployeePhoto > time { width: max-content; }

.adminGate {
  max-width: 650px;
  margin: 35px auto;
  text-align: center;
  padding: 34px;
}

.adminLockIcon {
  width: 64px;
  height: 64px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #0e2c39;
  color: #49dfaa;
  font-size: 24px;
  box-shadow: 0 14px 30px #0d2b3825;
}

.adminGate h2 { margin: 6px 0; font-size: 20px; }
.adminGate p { color: #7f8d96; font-size: 9px; line-height: 1.55; }

.adminGate form {
  display: flex;
  gap: 8px;
  max-width: 390px;
  margin: 20px auto 0;
}

.adminGate input {
  flex: 1;
  min-width: 0;
  padding: 11px;
  border: 1px solid #dce5e8;
  border-radius: 8px;
  text-align: center;
  letter-spacing: .2em;
  outline: 0;
}

.attendanceToolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.attendanceFilters {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 155px 145px;
  gap: 8px;
  flex: 1;
}

.attendanceFilters label {
  color: #77868f;
  font-size: 7px;
  font-weight: 900;
}

.attendanceFilters input,
.attendanceFilters select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  border: 1px solid #dfe6e9;
  border-radius: 7px;
  background: #fff;
  color: #263741;
  font-size: 8px;
  outline: 0;
}

.attendanceActions { display: flex; gap: 7px; flex-wrap: wrap; }
.dangerText { color: #b33b48; }
.attendanceTable { max-height: 64vh; border: 1px solid #e7edef; border-radius: 9px; }
.attendanceTable table { min-width: 1280px; }
.attendanceTable thead { position: sticky; top: 0; z-index: 3; background: #f7faf9; }
.attendanceTable td { vertical-align: middle; }

.recordEmployee {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 155px;
}

.recordEmployee b { display: block; font-size: 9px; }
.recordEmployee small { display: block; margin-top: 3px; color: #84929b; font-size: 7px; }

.recordPhoto {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #102d3a;
  color: #fff;
  font-weight: 900;
}

.recordPhoto img { width: 100%; height: 100%; object-fit: cover; }
.shiftMini { display: block; color: #6f808a; font-size: 7px; }
.shiftHours { display: block; margin-top: 3px; font-size: 8px; white-space: nowrap; }
.punchCell b { display: block; font-size: 10px; }

.punchCell button {
  margin-top: 4px;
  padding: 3px 5px;
  border: 0;
  border-radius: 4px;
  background: #e8f7f1;
  color: #11825c;
  font-size: 6px;
  font-weight: 900;
}

.timeVariance {
  display: inline-block;
  min-width: 48px;
  padding: 5px 6px;
  border-radius: 5px;
  text-align: center;
  font-size: 7px;
  font-weight: 900;
}

.timeVariance.good { background: #eef5f2; color: #75877e; }
.timeVariance.bad { background: #fde8ea; color: #bd3040; }
.timeVariance.warn { background: #fff0d7; color: #a46904; }
.workedTime { color: #263943; white-space: nowrap; }
.otTime { color: #11835d; white-space: nowrap; }

.recordStatus {
  display: inline-block;
  padding: 5px 7px;
  border-radius: 5px;
  background: #e8f7f1;
  color: #11835d;
  font-size: 6px;
  font-weight: 900;
  white-space: nowrap;
}

.recordStatus.late,
.recordStatus.late-early { background: #fde9eb; color: #b83140; }
.recordStatus.early-out { background: #fff1d8; color: #a36804; }
.recordStatus.missing-out,
.recordStatus.missing-in { background: #f0edf9; color: #674da1; }
.punchCount { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #edf4f1; color: #315146; font-size: 8px; font-weight: 900; }

.correctionCard { width: min(1180px, 100%); }
.correctionSearch { width: 100%; margin-bottom: 12px; }
.correctionTable { max-height: 58vh; border: 1px solid #e7edef; border-radius: 9px; }
.correctionTable table { min-width: 900px; }
.correctionTable thead { position: sticky; top: 0; z-index: 2; background: #f8faf9; }
.correctionTable td { vertical-align: middle; }
.correctedRow { background: #fffaf0; }
.reasonText { display: block; max-width: 150px; margin-top: 5px; color: #8f7130; font-size: 7px; }

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

.correctionSummary span {
  padding: 10px;
  border: 1px solid #e4ebe8;
  border-radius: 8px;
  color: #829099;
  font-size: 7px;
  background: #fbfcfc;
}

.correctionSummary b {
  display: block;
  color: #142b22;
  font-size: 16px;
  margin-bottom: 2px;
}

@media (max-width: 650px) {
  .accessResultCard.withEmployeePhoto {
    display: flex;
    flex-direction: column;
    text-align: center;
  }
  .accessResultIcon.hasPhoto { width: 82px; height: 82px; margin-bottom: 10px !important; }
  .adminGate { padding: 22px 15px; }
  .adminGate form { flex-direction: column; }
  .attendanceFilters { grid-template-columns: 1fr 1fr; width: 100%; }
  .attendanceActions { width: 100%; }
  .attendanceActions button { flex: 1; }
  .event {
    grid-template-columns: 44px 1fr auto;
    gap: 7px;
  }
  .eventTime { grid-column: 2 / -1; grid-row: 2; text-align: left; }
  .editPunch { grid-column: 3; grid-row: 1; }
  .punchEmployee { grid-template-columns: 36px 1fr; }
  .adjustedBadge { grid-column: 1 / -1; width: max-content; }
  .auditNotice { align-items: flex-start; flex-direction: column; }
  .correctionSummary { grid-template-columns: repeat(2, 1fr); }
  .correctionCard { padding: 14px; }
}

/* V6 Advanced — real dashboard, warehouses, devices */
.realChart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding: 8px 4px 18px;
}
.realChart .bar {
  flex: 1;
  min-width: 4px;
  background: linear-gradient(180deg, #22c55e 0%, #0ea5e9 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  opacity: .9;
}
.realChart .bar:hover { opacity: 1; filter: brightness(1.1); }
.realChart .barTip {
  display: none;
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  color: #829099;
  white-space: nowrap;
}
.recentFeed { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; }
.miniEvt {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e4ebe8;
  border-radius: 10px;
  background: #fbfcfc;
}
.miniEvt b { display: block; font-size: 12px; }
.miniEvt small { color: #829099; font-size: 10px; }
.evtBadge {
  display: grid;
  place-items: center;
  height: 32px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
}
.evtBadge.in { background: #e0f2fe; color: #0369a1; }
.evtBadge.out { background: #fef3c7; color: #b45309; }
.modules.compact { grid-template-columns: 1fr 1fr; gap: 8px; }
.siteActions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e4ebe8;
}
.sitecard.inactiveSite { opacity: .65; filter: grayscale(.35); }
.sitegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 650px) {
  .modules.compact { grid-template-columns: 1fr; }
  .realChart { height: 90px; }
}

/* Already scanned overlay */
.accessOverlay.alreadyScan .accessResultCard,
.accessResultCard.alreadyScan {
  background: linear-gradient(160deg, #0f766e 0%, #115e59 45%, #134e4a 100%) !important;
}
.punchTypeBanner.alreadyScan {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.4);
}
.accessState.alreadyScan { background: #ccfbf1; color: #0f766e; }
