:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --page: #f6f7fb;          /* Solid page background fixes the "column" */
  --card-bg: #ffffff;
  --radius: 16px;
  --transition: 0.25s ease;
}

/* Reset & base */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100svh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  display: grid;
  place-items: center;       /* centers the card */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 36px;
  background: var(--card-bg);       /* solid white, no frosted blur */
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  text-align: center;
  animation: fade-in 0.45s ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 24px;
}

/* ---------- Form ---------- */
.field { position: relative; margin-bottom: 14px; }

.field input {
  width: 100%;
  padding: 14px 44px 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 8px;
}

.toggle-password:hover { color: var(--primary); }

/* ---------- Button ---------- */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), transform 0.05s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

/* ---------- Messages ---------- */
#message {
  margin-top: 14px;
  font-size: 0.93rem;
  font-weight: 500;
  min-height: 1.2em;
}

.error { color: #d52731; }
.success { color: #269f53; }

/* ---------- Logout button ---------- */
/* Tiny logout icon (top-left of the page) */
.logout-icon {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.logout-icon i {
  font-size: 14px;   /* slightly larger than before */
  line-height: 1;
}

.logout-icon:hover { background: var(--primary-dark); }

/* ---------- Floating Action Buttons ---------- */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  z-index: 1000;
}

.fab-btn {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.fab-btn i {
  font-size: 22px;
}

.fab-btn:hover {
  transform: scale(1.1) translateY(-2px);
}

.fab-btn:active {
  transform: scale(0.95);
}

/* Search Button - Primary */
.fab-search {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
}

.fab-search:hover {
  box-shadow: 0 12px 35px rgba(59, 130, 246, 0.55);
}

/* Add Button - Secondary */
.add-code-btn {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.add-code-btn:hover {
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
}

/* Tooltip for FAB */
.fab-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  right: 70px;
  background: #1f2937;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  pointer-events: none;
}

.fab-btn:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ---------- Popup Overlay ---------- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 2000;
  padding: 20px;
}
.popup-overlay.active {
  display: grid;
}

/* ---------- Popup Card ---------- */
.popup-card {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  animation: popup-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes popup-in {
  from { opacity: 0; transform: scale(0.85) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.popup-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.popup-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  /* ADDED TO FIX CLICKING */
  position: relative;
  z-index: 10;
}

.popup-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--transition);
  /* ADDED TO FIX CLICKING */
  position: relative;
  z-index: 10;
}



.popup-close:hover {
  background: rgba(255,255,255,0.3);
}

.popup-body {
  padding: 24px;
}

.field-group {
  margin-bottom: 20px;
}
.field-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

/* Autocomplete */
.autocomplete-wrapper {
  position: relative;
}
.autocomplete-wrapper input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition);
}
.autocomplete-wrapper input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.suggestions-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.suggestions-box.show {
  display: block;
}
.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.9rem;
}
.suggestion-item:hover {
  background: #f0fdf4;
  color: #059669;
}

/* Textarea */
.popup-body textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Consolas', 'Monaco', monospace;
  outline: none;
  resize: vertical;
  transition: all var(--transition);
}
.popup-body textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.popup-footer {
  display: flex;
  gap: 14px;
  padding: 20px 28px 28px;
  justify-content: flex-end;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
}
.btn-cancel {
  padding: 14px 28px;
  background: #fff;
  color: #6b7280;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s;
}
.btn-cancel:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}
.btn-save {
  padding: 14px 28px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-save:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
}
.btn-save:active {
  transform: translateY(-1px);
}
.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


.logout-icon:active { transform: translateY(1px); }



/* ---------- Result Popup Styling (Modern) ---------- */
.result-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  text-align: center;
  padding: 0;
}

/* Green Gradient Header */
.result-top-decoration {
  height: 100px;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 40px;
  position: relative;
}

.success-ring {
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: #10b981;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  position: absolute;
  bottom: -40px; 
  animation: pop-bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-bounce {
  0% { transform: scale(0); bottom: -40px; }
  50% { transform: scale(1.2); bottom: -40px; }
  100% { transform: scale(1); bottom: -40px; }
}

.result-content {
  padding: 0 24px;
}

.result-content h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: #111827;
}

.result-desc {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0 0 24px;
}

/* Modern Code Box */
.modern-code-box {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px 12px 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.modern-code-box:hover {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.code-value {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: 2px;
}

.modern-copy-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  color: #6b7280;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.2s;
}

.modern-copy-btn:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.modern-copy-btn.copied {
  background: #10b981;
  color: #fff;
}

.result-note {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0;
  margin-bottom: 24px;
}

.result-actions {
  padding: 0 24px 24px;
}

.btn-done {
  width: 100%;
  padding: 16px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-done:hover {
  background: #000;
}
.btn-done:active {
  transform: scale(0.98);
}


/* ---------- History / Logs UI ---------- */
.history-btn {
  position: fixed;
  bottom: 90px; /* Above the Add Code button */
  left: 20px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  transition: all 0.25s ease;
  z-index: 1000;
}
.history-btn:hover { transform: scale(1.1); }
.history-btn i { font-size: 22px; }

/* Table Styling */
/* Update this existing class to remove scroll */
.table-container {
  /* max-height: 60vh;  <-- REMOVED */
  /* overflow-y: auto;  <-- REMOVED */
  width: 100%;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.history-table th {
  background: #f9fafb;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
  border-bottom: 2px solid #e5e7eb;
}
.history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
}
.history-table tr:hover td { background: #f9fafb; }

/* Badge style for code */
.code-badge {
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: 700;
  border: 1px solid #dbeafe;
}


/* ---------- New Dashboard Styles ---------- */
.dashboard-wrapper {
  width: 100%;
  max-width: 800px;
  padding: 0;
  animation: fade-in 0.5s ease both;
  
  /* UPDATED: More space at top and between cards */
  padding-top: 60px; 
  gap: 32px; 
  display: flex;
  flex-direction: column;
}

/* Action Buttons Area */
.dashboard-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.action-card-btn {
  background: #fff;
  border: none;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02), 0 10px 15px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: left;
}

.action-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
}
.icon-box.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.text-box { flex: 1; }
.text-box h3 { margin: 0 0 4px; font-size: 1.1rem; color: #111827; }
.text-box p { margin: 0; font-size: 0.9rem; color: #6b7280; }
.arrow { color: #d1d5db; }

/* Dashboard Card (History) */
.dashboard-card {
  max-width: 100%; 
  padding: 0; 
  overflow: hidden;
  text-align: left;

  /* NEW: Border and Separation */
  margin-bottom: 40px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 
              0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
}
.refresh-btn:hover { background: #f3f4f6; color: var(--primary); }

.loading-text { text-align: center; padding: 20px; color: #6b7280; }


/* ---------- History List Card Style ---------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  padding-bottom: 100px; /* Space for FAB buttons */
}

.history-card {
  background: #fff;
  /* UPDATED: Added Border */
  border: 1px solid #e2e8f0; 
  border-radius: 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  
  /* UPDATED: Changed to visible so we can draw the line outside */
  overflow: visible;
  position: relative;
  
  /* UPDATED: Increased spacing to fit the line */
  margin-bottom: 24px; 
}

/* NEW: The Separation Line Element */
.history-card:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: -12px; /* Centers line in the margin gap */
  left: 10%;     /* Indent from left */
  width: 80%;    /* Width of the line */
  height: 1px;
  background: linear-gradient(
    90deg, 
    rgba(229, 231, 235, 0) 0%, 
    rgba(209, 213, 219, 1) 50%, 
    rgba(229, 231, 235, 0) 100%
  );
  pointer-events: none;
}

.history-card:hover {
  border-color: #3b82f6; /* Blue border on hover */
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.card-info {
  flex: 1;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-info div {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-info div:first-child {
  color: #9ca3af;
  font-size: 0.8rem;
}

.card-info strong {
  font-weight: 500;
  color: #9ca3af;
  margin-right: 0;
  min-width: 70px;
  font-size: 0.8rem;
}

.card-info span {
  color: #374151;
  font-weight: 500;
}

.card-code {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 130px;
  border-left: 1px solid #e0e7ff;
  border-radius: 0 16px 0 0;
}

.card-code > div {
  font-size: 0.7rem !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6b7280 !important;
  margin-bottom: 6px !important;
}

.card-image-section {
  background: #f9fafb;
  border-radius: 0 0 16px 16px;
  padding: 10px;
  text-align: center;
}

.evidence-img {
  max-width: 100%;
  max-height: 400px; /* Limit height so it doesn't fill screen */
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: block;
  margin: 0 auto;
}

/* Badge update */
.code-badge-large {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  border: none;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  letter-spacing: 1px;
}

/* ---------- Pagination Styling ---------- */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px 0 10px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: default;
  background: #f3f4f6;
}

.page-dots {
  color: #9ca3af;
  letter-spacing: 2px;
  padding: 0 4px;
}

/* Add to style.css */

/* ---------- Low Stock Section ---------- */
.low-stock-wrapper {
  animation: fade-in 0.5s ease both;
  display: none; 

  /* NEW: Card Styling */
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px; 
  border: 1px solid #fecaca; /* Red warning border */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.low-stock-header {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;

  /* UPDATED: Red text and divider line */
  margin-top: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #fff1f2;
  margin-bottom: 16px;
  font-size: 1rem;
  color: #dc2626; 
}

.low-stock-header i {
  color: #ef4444; /* Red warning icon */
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stock-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #fee2e2;
  padding: 8px 10px 8px 14px;
  border-radius: 99px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stock-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  border-color: #fecaca;
}

.chip-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-badge {
  background: #ef4444; /* Red background */
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  height: 24px;
  min-width: 24px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 0 6px;
}

.chip-badge.warning {
  background: #f59e0b; /* Orange if count is 2 or 3 */
}
.chip-badge.critical {
  background: #ef4444; /* Red if count is 1 */
}


/* ---------- Input Loading Overlay ---------- */
.input-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  z-index: 5;
  backdrop-filter: blur(2px);
}

.spinner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- Confirmation Popup Styles ---------- */
.confirm-card {
  max-width: 450px;
  text-align: center;
  overflow: hidden;
}

.confirm-header {
  background: #fff;
  padding: 30px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.warning-icon {
  width: 64px;
  height: 64px;
  background: #ffedd5;
  color: #ea580c;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  box-shadow: 0 0 0 8px #fff7ed;
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #111827;
}

.confirm-message {
  font-size: 1rem;
  color: #374151;
  line-height: 1.6;
  margin: 0;
  background: #fff7ed;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #fed7aa;
  text-align: left;
}



/* ---------- Section Separation Line ---------- */
.section-divider {
  height: 1px;
  width: 90%;
  margin: 0 auto; /* Centers the line */
  background: linear-gradient(
    90deg, 
    rgba(229, 231, 235, 0) 0%, 
    rgba(209, 213, 219, 1) 50%, 
    rgba(229, 231, 235, 0) 100%
  );
  flex-shrink: 0;
}



/* ---------- Missing Students Section ---------- */
.missing-section {
  animation: fade-in 0.5s ease both;
  margin-bottom: 16px;
}

.missing-badge-standalone {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.missing-badge-standalone:hover {
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.missing-badge-standalone > i:first-child {
  color: #d97706;
  font-size: 1.2rem;
}

.missing-badge-standalone > span {
  flex: 1;
  font-weight: 600;
  color: #92400e;
  font-size: 0.95rem;
}

.missing-badge-standalone #missingCount {
  background: #f59e0b;
  color: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 700;
}

.missing-badge-standalone > i:last-child {
  color: #b45309;
  font-size: 0.9rem;
}

/* Keep old badge style for backward compatibility */
.missing-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
}

.missing-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

/* Missing List Styling */
.missing-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.missing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  transition: all 0.2s;
}

.missing-item:hover {
  background: #ffedd5;
  border-color: #fdba74;
}

.missing-item i {
  color: #d97706;
  font-size: 1rem;
}

.missing-item-info {
  flex: 1;
}

.missing-item-name {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.missing-item-email {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Zero code badge styling */
.chip-badge.zero {
  background: #374151;
}


/* ---------- Security Key Popup Styles ---------- */
.security-card {
  max-width: 420px;
  text-align: center;
  overflow: hidden;
}

.security-header {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  padding: 40px 24px 30px;
  position: relative;
  overflow: hidden;
}

.security-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.security-header::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: -20%;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.security-icon {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 0 0 15px rgba(255,255,255,0); }
}

.security-header h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: #fff;
  position: relative;
  z-index: 1;
}

.security-header p {
  margin: 0;
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.security-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.security-input-wrapper:focus-within {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.security-input-wrapper > i:first-child {
  padding: 0 0 0 16px;
  color: #94a3b8;
  font-size: 1.1rem;
}

.security-input-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 16px 12px;
  font-size: 1rem;
  outline: none;
  color: #1e293b;
}

.security-input-wrapper input::placeholder {
  color: #94a3b8;
}

.toggle-security-key {
  background: transparent;
  border: none;
  padding: 16px;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}

.toggle-security-key:hover {
  color: #6366f1;
}

.security-error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 10px;
  min-height: 20px;
  text-align: left;
}

.btn-verify {
  padding: 14px 28px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-verify:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.btn-verify:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
}

.btn-verify:active {
  transform: translateY(-1px);
}

.center-footer {
  justify-content: center;
}