/* Galeri kad bergambar besar */
.header-actions { display: flex; align-items: center; gap: 9px; }
.review-link { background: var(--green); color: white; text-decoration: none; padding: 8px 13px; border-radius: 100px; font-size: 12px; font-weight: 800; }
.review-link.secondary-link { background: #e5ebe7; color: var(--green); }
.toolbar { grid-template-columns: 1fr 180px 220px auto; }
.desktop-table { display: none; }
.mobile-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.student-card { display: block; min-width: 0; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 16px; transition: transform .18s, box-shadow .18s; }
.student-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(16,39,27,.1); }
.student-card.return-highlight { outline: 3px solid var(--lime); outline-offset: 3px; animation: returnPulse 1.5s ease-out; }
@keyframes returnPulse { 0% { transform: scale(.97); } 45% { transform: scale(1.015); } 100% { transform: scale(1); } }
.student-card > img { width: 100%; height: 285px; display: block; object-fit: cover; object-position: center top; border-radius: 12px; background: #e8eee9; }
.student-card > div { padding: 13px 3px 3px; }
.student-card h3 { min-height: 42px; margin: 10px 0 5px; font: 800 14px/1.35 Manrope; }
.student-card p { margin: 0 0 13px; color: var(--muted); }
.student-card .view-btn { width: 100%; min-height: 42px; }
.image-status { display: inline-block; white-space: nowrap; border-radius: 100px; padding: 5px 9px; font-size: 10px; font-weight: 800; }
.image-status.suspected { background: #ffe1dd; color: #9b2d25; }
.image-status.clear { background: #dff4e6; color: #17683b; }
.image-status.review { background: #fff0c7; color: #845b00; }
.image-status.pending { background: #e9ecea; color: #66716a; }

/* Paparan gambar besar dan navigasi rekod */
.modal {
  width: min(1120px, 100%);
  grid-template-columns: minmax(480px, 1.2fr) minmax(360px, .8fr);
}

.photo-panel {
  min-height: 640px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-panel img {
  width: 100%;
  height: 596px;
  max-height: none;
  object-fit: contain;
  background: #d4ddd7;
}

.photo-panel .class-tag {
  left: 38px;
  bottom: 38px;
}

.detail-panel {
  display: flex;
  flex-direction: column;
  padding: 54px 42px;
}

.record-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 32px;
}

.record-nav a {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .15s;
}

.record-nav a:hover {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.record-nav .next {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.record-nav strong {
  text-align: center;
  font: 800 17px Manrope;
  white-space: nowrap;
}

.record-nav strong small {
  color: var(--muted);
  font-size: 12px;
}

.keyboard-hint {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin: 10px 0 0;
}

@media (max-width: 900px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
  .toolbar .reset { min-height: 52px; }
  .mobile-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .student-card > img { height: 250px; }
  .modal { grid-template-columns: minmax(400px, 1fr) minmax(320px, .8fr); }
  .photo-panel { min-height: 560px; }
  .photo-panel img { height: 516px; }
  .detail-panel { padding: 44px 28px; }
}

@media (max-width: 650px) {
  .header-actions .status { display: none; }
  .review-link { padding: 7px 11px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
  .toolbar .filter { grid-column: auto; }
  .toolbar .reset { grid-column: 1 / -1; min-height: 44px; }
  .mobile-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .student-card { display: block; padding: 8px; }
  .student-card > img { width: 100%; height: 210px; }
  .student-card > div { padding: 10px 2px 2px; }
  .student-card h3 { min-height: 52px; font-size: 12px; }
  .student-card .image-status { margin-top: 5px; }
  .modal { display: block; }
  .photo-panel { height: 52vh; min-height: 370px; padding: 12px; }
  .photo-panel img { height: 100%; max-height: none; }
  .photo-panel .class-tag { left: 24px; bottom: 24px; }
  .detail-panel { padding: 26px 18px; }
  .record-nav {
    position: sticky;
    bottom: 0;
    background: white;
    margin: 25px -18px -26px;
    padding: 12px 18px 16px;
    box-shadow: 0 -10px 25px rgba(16,39,27,.08);
  }
  .record-nav a { min-height: 50px; }
  .keyboard-hint { display: none; }
}
