/* =========================================================
   STYLE OPERATOR SCANNER WISUDA
   ========================================================= */

.operator-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
}

/* Header */
.operator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: var(--gold-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-300);
  letter-spacing: 0.04em;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-status-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.stats-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-400);
}

.stats-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Main Grid Layout */
.main-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1250px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Scanner Card */
.scanner-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Status Banner Scanner Fisik */
.scanner-gun-status {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 78, 59, 0.3));
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
}

.scanner-gun-status.scanning {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.2);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.scanner-pulse-icon {
  width: 36px;
  height: 36px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 0 12px #10b981;
  animation: pulseScanner 2s infinite;
}

@keyframes pulseScanner {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Tab Selector Mode Scan */
.scan-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tab-btn.active {
  background: var(--gold-gradient);
  color: #111;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

/* Input Manual / USB Scanner */
.usb-scan-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--gold-500);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
  background: rgba(0, 0, 0, 0.6);
}

.autofocus-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Camera Scanner Container */
.camera-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #060911;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-reader {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

#camera-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 0.75rem;
  padding: 1rem;
  text-align: center;
}

.camera-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

/* Active Scanned Student Card */
.active-student-card {
  background: linear-gradient(135deg, rgba(28, 37, 65, 0.9), rgba(11, 19, 43, 0.95));
  border: 1px solid var(--gold-500);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-gold);
}

.active-student-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.active-student-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-500);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.active-student-info h3 {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
}

.active-student-info p {
  font-size: 0.85rem;
  color: var(--gold-300);
}

.active-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Database Section */
.database-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.database-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 320px;
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  max-height: 650px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold-300);
  font-family: var(--font-serif);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.data-table tr.row-active {
  background: rgba(212, 175, 55, 0.12);
  border-left: 3px solid var(--gold-500);
}

.student-row-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-gold);
}

.action-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  transform: scale(0.95);
  transition: all 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--gold-300);
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Photo upload preview */
.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.photo-preview-box {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px dashed var(--gold-500);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.photo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal Tabs (Khusus Pengaturan) */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.settings-tab-btn {
  background: none;
  border: none;
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.settings-tab-btn.active {
  color: var(--gold-300);
  border-bottom-color: var(--gold-500);
}

.settings-pane {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-pane.active {
  display: flex;
}
