.card-soft { border-radius: 14px; }
.badge-available { background: #198754; }
.badge-borrowed { background: #fd7e14; }
.table td, .table th { vertical-align: middle; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.qr-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; }

/* Fullscreen QR scanner overlay (Borrow/Return) */
.qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.96);
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.qr-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0,0,0,.98);
  padding-top: calc(12px + env(safe-area-inset-top));
}

.qr-topbar .qr-stop-btn {
  position: absolute;
  left: 12px;
  top: calc(12px + env(safe-area-inset-top));
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 .25rem .75rem rgba(0,0,0,.35);
}

.qr-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

#qr-reader {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

/* html5-qrcode internal region ids */
#qr-reader__scan_region {
  width: 100% !important;
  height: calc(100vh - 84px) !important;
  max-height: calc(100vh - 84px) !important;
  overflow: hidden;
  border-radius: 16px;
}

/* Make the camera preview fill the scan region */
#qr-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 16px;
}

#qr-reader canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 16px;
}

/* Hide the library's built-in header elements to keep it clean */
#qr-reader__dashboard_section,
#qr-reader__status_span {
  display: none !important;
}
