/* ==========================================================================
   STUDENT CHECK-IN WEB APPLICATION - STYLES.CSS
   Aesthetics: Modern Glassmorphism, Premium UI, Customizable Themes & Printing
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties (Theme Variables) */
:root {
  --primary-color: #6366f1; /* Modern Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --accent-color: #f43f5e; /* Rose */
  --success-color: #10b981; /* Emerald */
  --warning-color: #f59e0b; /* Amber */
  --info-color: #06b6d4; /* Cyan */
  
  /* Light Mode Colors */
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-input: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;
  --border-color: rgba(226, 232, 240, 0.8);
  --border-focus: #6366f1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
  --blur-amount: 12px;
  --glass-border: rgba(255, 255, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Colors overrides */
body.dark-mode {
  --bg-app: #090d16;
  --bg-sidebar: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.6);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --bg-input: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(51, 65, 85, 0.5);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --bg-input: rgba(30, 41, 59, 0.8);
}

/* General Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
}

html, body {
  height: 100%;
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background-color: transparent;
}

.sidebar-brand-info {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  line-height: 1.2;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-item:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
}

.menu-item.active {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.menu-item i, .menu-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--info-color));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
  text-transform: uppercase;
  margin-top: 2px;
}

.role-developer {
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--info-color);
}

.role-admin {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
}

.role-general {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--primary-color);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem;
  background-color: rgba(244, 63, 94, 0.08);
  color: var(--accent-color);
  border: 1px dashed rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background-color: var(--accent-color);
  color: #fff;
}

/* Main Content Area */
.main-content {
  margin-left: 280px;
  padding: 2.5rem;
  flex-grow: 1;
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* Top Bar / Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  gap: 1.5rem;
}

.header-title-section {
  display: flex;
  flex-direction: column;
}

.header-title-section h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2rem;
  color: var(--text-main);
  background: linear-gradient(to right, var(--text-main), var(--primary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-input);
  transform: translateY(-2px);
}

.btn-accent {
  background-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.2);
}

.btn-accent:hover {
  background-color: #e11d48;
  transform: translateY(-2px);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-input);
  transform: scale(1.05);
}

/* Glassmorphism Card System */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-glass), var(--shadow-md);
  margin-bottom: 2rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal);
  animation: fadeIn 0.4s ease-out;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glass), var(--shadow-lg);
}

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

.card-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseBorder {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Login Page Layout */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(135deg, var(--bg-app) 0%, rgba(99, 102, 241, 0.08) 50%, rgba(6, 182, 212, 0.05) 100%);
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  text-align: center;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-logo-container {
  margin-bottom: 1.5rem;
}

.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background-color: transparent;
  object-fit: cover;
  padding: 0;
}

.login-title {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: var(--bg-sidebar);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}

/* Views Styles (Registration View) */
.registration-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .registration-grid {
    grid-template-columns: 1fr;
  }
}

/* Photo Capture Section */
.photo-capture-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.photo-preview-box {
  width: 100%;
  aspect-ratio: 4/5;
  background-color: var(--bg-input);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.photo-preview-box.recording {
  animation: pulseBorder 2s infinite;
  border-color: var(--primary-color);
}

.webcam-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view */
}

.captured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem;
}

.photo-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.7;
  color: var(--primary-color);
}

.photo-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.photo-actions .btn {
  flex: 1;
}

/* Modal Windows */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(9, 13, 22, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
}

/* Registration Success Popup Template (Card Badge Design) */
.badge-popup-card {
  text-align: center;
  padding: 1rem;
  background-color: #fff; /* White background for badge representation */
  color: #0f172a;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.badge-header-band {
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.5rem;
  margin: -1rem -1rem 1rem -1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.badge-header-band img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
}

.badge-school-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.badge-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  text-align: left;
  align-items: center;
}

.badge-photo-box {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background-color: #f1f5f9;
}

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

.badge-info-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.badge-info-name {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.3;
}

.badge-info-id {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.badge-info-meta {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.badge-qrcode-container {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  padding-top: 0.75rem;
  border-top: 1px dashed #cbd5e1;
}

.badge-qrcode-container canvas, .badge-qrcode-container img {
  width: 110px;
  height: 110px;
}

/* Check-in View Grid */
.checkin-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .checkin-grid {
    grid-template-columns: 1fr;
  }
}

.scanner-viewport-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.scanner-video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  gap: 1rem;
  text-align: center;
  z-index: 10;
  background-color: #0f172a;
}

.scanner-video-placeholder svg {
  width: 64px;
  height: 64px;
  opacity: 0.5;
  color: var(--primary-color);
}

.checkin-start-time-control {
  display: grid;
  grid-template-columns: auto 130px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-sidebar);
}

.checkin-start-time-control .form-label {
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
}

.checkin-start-time-control span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* QR Code Scan overlay guide */
.scanner-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  z-index: 5;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.scanner-guide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
  animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* Hidden input for physical scanners */
.physical-scanner-input-field {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.hardware-scan-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  color: var(--success-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.hardware-scan-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  animation: pulseLight 1.5s infinite;
}

@keyframes pulseLight {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

/* NFC simulator widget */
.nfc-simulator-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background-color: var(--bg-input);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nfc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.nfc-tap-emulator-zone {
  height: 100px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.nfc-tap-emulator-zone:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-card);
  color: var(--primary-color);
}

.nfc-tap-emulator-zone svg {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

/* Check-in feed (log of scanned students) */
.checkin-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

.checkin-log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  animation: fadeIn 0.3s ease-out;
}

.checkin-log-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.checkin-log-details {
  flex-grow: 1;
  overflow: hidden;
}

.checkin-log-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.checkin-log-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.checkin-log-status-tick {
  color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.1);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.late-status-text {
  margin-top: 4px;
  color: var(--success-color);
  font-size: 0.75rem;
  font-weight: 600;
}

.late-status-text.is-late {
  color: var(--accent-color);
}

/* Management Table View */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.search-wrapper {
  position: relative;
  min-width: 300px;
}

.search-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.search-wrapper input {
  padding-left: 2.75rem;
}

.table-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

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

.app-table th {
  background-color: var(--bg-input);
  color: var(--text-main);
  padding: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.app-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.app-table tbody tr:last-child td {
  border-bottom: none;
}

.app-table tbody tr:hover td {
  background-color: var(--bg-input);
}

.table-student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-student-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #e2e8f0;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-checked {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.status-pending {
  background-color: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
}

.action-icon-group {
  display: flex;
  gap: 8px;
}

.action-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
}

.action-icon-btn.delete-action:hover {
  background-color: rgba(244, 63, 94, 0.1);
  color: var(--accent-color);
}

/* QR and Badge operations view (Single View) */
.student-ops-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.ops-student-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 2rem;
  text-align: left;
}

.ops-student-photo {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  background-color: var(--bg-sidebar);
  background-position: center;
  background-size: cover;
  color: var(--text-muted);
}

.ops-student-photo.is-clickable {
  cursor: zoom-in;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.ops-student-photo.is-clickable:hover,
.ops-student-photo.is-clickable:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 0 0 4px var(--primary-glow);
  outline: none;
}

.ops-student-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ops-student-photo svg {
  width: 36px;
  height: 36px;
}

.student-photo-modal-content {
  max-width: min(90vw, 800px);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.student-photo-large {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.ops-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.points-date-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.points-date-filter .form-control {
  width: auto;
  min-width: 145px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

#view-management .points-date-filter .form-control {
  min-width: 145px;
}

.points-date-filter + .points-date-filter {
  margin-left: 2px;
}

/* System Configuration View */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.color-palette-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition-fast);
}

.color-option.active {
  border-color: var(--text-main);
  transform: scale(1.1);
}

.custom-color-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.custom-color-control input {
  width: 38px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.switch-control-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.switch-control-wrapper:last-child {
  border-bottom: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-input);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

input:checked + .slider {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* User management specific fields */
.settings-users-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.settings-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-sidebar);
}

.user-photo-editor {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-photo-preview,
.settings-user-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
}

.form-hint {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Import dialog styling */
.file-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  background-color: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}

.file-dropzone:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-card);
  color: var(--text-main);
}

.file-dropzone svg {
  width: 48px;
  height: 48px;
  color: var(--primary-color);
  opacity: 0.8;
}

/* Custom Alert / Toast Message Overlay */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-sidebar);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--primary-color);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all var(--transition-normal);
}

.toast-success { border-left-color: var(--success-color); }
.toast-warning { border-left-color: var(--warning-color); }
.toast-error { border-left-color: var(--accent-color); }
.toast-info { border-left-color: var(--info-color); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   PRINT STYLES (NAME BADGE LAYOUT)
   ========================================================================== */
@media print {
  @page {
    size: 100mm 75mm;
    margin: 0;
  }

  /* Hide all elements except the printable container during printing */
  body > *:not(#print-badge-container) {
    display: none !important;
  }
  
  /* Explicitly hide the preview card layout from printing */
  #print-preview-card-wrapper .printable-badge-card,
  .printable-badge-card.preview-mode,
  .preview-mode {
    display: none !important;
    visibility: hidden !important;
  }
  
  #print-badge-container {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100vh !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Printable Badge Styles - Kept outside @media print so html2canvas can capture them with correct sizes */
.printable-badge-card {
  visibility: visible !important;
  width: 100mm !important;
  height: 75mm !important;
  padding: 10mm 12mm !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border: none !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-family: 'Outfit', 'Inter', sans-serif !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  page-break-after: always !important;
  overflow: hidden !important;
  position: relative !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
  border-radius: 8px !important;
}

/* Portrait Badge (105 x 148 mm) for custom template */
.printable-badge-card.badge-portrait {
  width: 105mm !important;
  height: 148mm !important;
  padding: 12mm !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  text-align: center !important;
  gap: 8mm !important;
}

.printable-badge-card.badge-portrait .printable-badge-info-panel {
  padding-right: 0 !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  gap: 4mm !important;
  margin-top: 0 !important;
}

.printable-badge-card.badge-portrait .printable-badge-text {
  align-items: center !important;
}

.printable-badge-card.badge-portrait .printable-badge-name {
  font-size: 20pt !important;
  color: #0f172a !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.printable-badge-card.badge-portrait .printable-badge-id {
  font-size: 14pt !important;
  color: var(--primary-color) !important;
  margin-top: 4px !important;
}

.printable-badge-card.badge-portrait .printable-badge-subject {
  font-size: 12pt !important;
  color: #475569 !important;
  border-left: none !important;
  padding-left: 0 !important;
}

.printable-badge-card.badge-portrait .printable-badge-qrcode-wrapper {
  margin-bottom: 8mm !important;
}

.printable-badge-card.badge-portrait .printable-badge-photo-wrapper {
  display: flex !important;
  justify-content: center !important;
  margin-bottom: 5mm !important;
  width: 100% !important;
}

.printable-badge-card.badge-portrait .printable-badge-photo {
  width: 32mm !important;
  height: 32mm !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 3px solid var(--primary-color) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Scaling down the badge cards inside the preview modal so they fit on screen */
#print-preview-card-wrapper .printable-badge-card {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

#print-preview-card-wrapper .printable-badge-card:not(.badge-portrait) {
  transform: scale(0.75) !important;
  margin: -15px -20px !important;
}

#print-preview-card-wrapper .printable-badge-card.badge-portrait {
  transform: scale(0.52) !important;
  margin: -60px -50px !important;
}


/* Info details on badge */
.printable-badge-info-panel {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 6mm !important;
  height: 100% !important;
  position: relative !important;
  flex: 1 !important;
  padding-right: 4mm !important;
}

.printable-badge-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.printable-badge-name {
  font-size: 18pt !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  color: #0f172a !important;
  letter-spacing: -0.2px !important;
}

.printable-badge-id {
  font-size: 11pt !important;
  font-weight: 700 !important;
  font-family: 'Outfit', monospace !important;
  color: #000000 !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin-top: 5px !important;
  border: none !important;
}

.printable-badge-subject {
  font-size: 10pt !important;
  font-weight: 600 !important;
  color: #475569 !important;
  border-left: 3px solid var(--primary-color, #6366f1) !important;
  padding-left: 8px !important;
  margin-top: 6px !important;
}

.printable-badge-qrcode-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 28mm !important;
  height: 28mm !important;
  flex-shrink: 0 !important;
}

.printable-badge-qrcode {
  width: 28mm !important;
  height: 28mm !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 2px !important;
  background-color: #ffffff !important;
  box-sizing: border-box !important;
}

.printable-badge-qrcode canvas {
  display: none !important;
}

.printable-badge-qrcode img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Helper styles for printing preview within the app */
.badge-preview-container-mock {
  width: 100mm;
  height: 75mm;
  border: none;
  border-radius: var(--radius-md);
  padding: 12mm;
  box-sizing: border-box;
  background-color: var(--bg-sidebar);
  color: var(--text-main);
  display: grid;
  grid-template-columns: 1fr 28mm;
  grid-gap: 8mm;
  align-items: center;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
}

.badge-preview-info-panel-mock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8mm;
  height: 100%;
  position: relative;
  text-align: left;
}

.badge-preview-name-mock {
  font-size: 14pt;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.badge-preview-id-mock {
  font-size: 9.5pt;
  font-weight: 700;
  font-family: 'Outfit', monospace;
  color: var(--text-main);
  background-color: transparent;
  padding: 0;
  margin-top: 3px;
  border: none;
}

.badge-preview-subject-mock {
  font-size: 8.5pt;
  font-weight: 600;
  color: var(--text-muted);
  border-left: 2.5px solid var(--primary-color);
  padding-left: 6px;
  margin-top: 4px;
}

.badge-preview-qrcode-wrapper-mock {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 28mm;
  height: 100%;
}

.badge-preview-qrcode-mock {
  width: 28mm;
  height: 28mm;
  border: none;
  border-radius: 8px;
  padding: 2px;
  background-color: #ffffff;
  box-sizing: border-box;
}

.badge-preview-qrcode-mock canvas {
  display: none !important;
}

.badge-preview-qrcode-mock img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Hidden element to contain printable cards for printing action */
#print-badge-container {
  display: none;
}

#print-badge-container.rendering-canvas {
  display: block !important;
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  z-index: 99999 !important;
}

/* CSS class to show printed elements in preview container */
@media screen {
  #print-badge-container:not(.rendering-canvas) {
    display: none !important; /* Hide on screen since it's only meant for the print spooler */
  }
}

/* Active Check-in Mode Selector styles */
.mode-tabs-container {
  display: flex;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-top: 4px;
}

.mode-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: none;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-tab-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.mode-tab-btn.active {
  color: #fff !important;
  background-color: var(--primary-color) !important;
  box-shadow: 0 4px 12px var(--primary-glow);
}

body.dark-mode .mode-tab-btn.active {
  color: #fff !important;
  background-color: var(--primary-color) !important;
}

/* ==========================================================================
   KIOSK FULLSCREEN MODE STYLES
   ========================================================================== */
.kiosk-controls {
  display: flex;
  justify-content: flex-end;
  max-width: 700px;
  margin: 0 auto 1rem auto;
  transition: all var(--transition-normal);
}

body.kiosk-fullscreen .sidebar {
  display: none !important;
}

body.kiosk-fullscreen .main-content {
  margin-left: 0 !important;
  padding: 0 !important;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body.kiosk-fullscreen .main-header {
  display: none !important;
}

body.kiosk-fullscreen #view-kiosk {
  flex-grow: 1;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  padding: 2rem;
  box-sizing: border-box;
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.05), transparent 40%),
              radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.05), transparent 40%),
              var(--bg-app);
}

body.kiosk-fullscreen #view-kiosk .glass-card {
  width: 100%;
  max-width: 800px;
  margin: auto;
  padding: 3.5rem 3rem !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

body.kiosk-fullscreen .kiosk-controls {
  display: none !important;
}

/* Kiosk Search Results styling */
.kiosk-search-results-list {
  display: none;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 8px;
  box-shadow: var(--shadow-md);
  z-index: 10;
  position: relative;
}

.kiosk-search-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.kiosk-search-item:last-child {
  border-bottom: none;
}

.kiosk-search-item:hover {
  background-color: var(--bg-input);
  transform: translateX(4px);
}

.kiosk-search-item strong {
  color: var(--text-main);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
}

.kiosk-search-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Custom Kiosk Background Image styles */
#view-kiosk.has-kiosk-bg {
  position: relative;
  z-index: 1;
}

/* Base overlay inside #view-kiosk to soften background image contrast and improve readability */
#view-kiosk.has-kiosk-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(248, 250, 252, 0.45); /* Soft overlay for light mode */
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  transition: background-color var(--transition-normal);
}

body.dark-mode #view-kiosk.has-kiosk-bg::before {
  background-color: rgba(9, 13, 22, 0.75); /* Darker overlay for dark mode */
}

/* Ensure the glass card and controls inside the kiosk view are above the background overlay */
#view-kiosk.has-kiosk-bg > * {
  position: relative;
  z-index: 1;
}

/* Kiosk Scan Target 4-Corner Viewfinder Brackets */
.kiosk-scan-target {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 3.5rem;
  margin: 1.5rem auto 2.5rem auto;
  text-align: center;
  min-width: 250px;
  box-sizing: border-box;
}

.kiosk-scan-target::before,
.kiosk-scan-target::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 4px solid var(--primary-color);
}

/* Top-left */
.kiosk-scan-target::before {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

/* Top-right */
.kiosk-scan-target::after {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

/* Bottom brackets on helper span */
.kiosk-scan-target .scan-bracket::before,
.kiosk-scan-target .scan-bracket::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 4px solid var(--primary-color);
  bottom: 0;
}

/* Bottom-left */
.kiosk-scan-target .scan-bracket::before {
  left: 0;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

/* Bottom-right */
.kiosk-scan-target .scan-bracket::after {
  right: 0;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

/* Server Status Badge styling */
.server-status-badge.online .status-dot {
  background-color: var(--success-color) !important;
  box-shadow: 0 0 8px var(--success-color);
  animation: pulse-green 2s infinite;
}
.server-status-badge.offline .status-dot {
  background-color: var(--accent-color) !important;
  box-shadow: 0 0 8px var(--accent-color);
}
@keyframes pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Fullscreen Sidebar Hide Override */
.app-container.fullscreen-active .sidebar {
  display: none !important;
}
.app-container.fullscreen-active .main-content {
  margin-left: 0 !important;
}

/* Tablet / iPad (Landscape and Portrait) */
@media (max-width: 1100px) {
  .sidebar {
    width: 220px;
    padding: 1.5rem 1rem;
  }
  .main-content {
    margin-left: 220px;
    padding: 1.5rem;
  }
}

/* Tablet Portrait & Large Phones */
@media (max-width: 850px) {
  .sidebar {
    width: 80px;
    padding: 1rem 0.5rem;
    align-items: center;
  }
  .sidebar-brand-info, 
  .sidebar-menu span, 
  .sidebar-title, 
  .sidebar-user-info, 
  .logout-btn span {
    display: none;
  }
  .sidebar-brand {
    justify-content: center;
    margin-bottom: 2rem;
  }
  .sidebar-logo {
    width: 36px;
    height: 36px;
  }
  .sidebar-menu a {
    justify-content: center;
    padding: 0.8rem;
  }
  .sidebar-menu a i {
    margin-right: 0;
  }
  .logout-btn {
    justify-content: center;
    padding: 0.8rem;
  }
  .logout-btn i {
    margin-right: 0;
  }
  .main-content {
    margin-left: 80px;
    padding: 1.25rem;
  }
  .header-title-section h1 {
    font-size: 1.5rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-grid,
  .registration-grid,
  .checkin-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Phones */
@media (max-width: 600px) {
  .checkin-start-time-control {
    grid-template-columns: 1fr 110px;
  }

  .checkin-start-time-control span {
    grid-column: 1 / -1;
  }

  .sidebar {
    width: 60px;
    padding: 1rem 0.25rem;
  }
  .main-content {
    margin-left: 60px;
    padding: 1rem;
  }
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .table-responsive {
    overflow-x: auto;
  }
}

/* Small-screen usability overrides */
@media (max-width: 600px) {
  .main-content {
    width: calc(100% - 60px);
    min-width: 0;
    padding: 0.75rem;
  }

  .main-header {
    margin-bottom: 1rem;
  }

  .header-title-section,
  .header-title-section h1,
  .header-title-section p {
    max-width: 100%;
  }

  .header-title-section h1 {
    font-size: 1.3rem;
    line-height: 1.25;
  }

  .header-title-section p {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .glass-card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }

  .card-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .card-title {
    font-size: 1.15rem;
  }

  .btn {
    min-height: 42px;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
  }

  .photo-actions {
    flex-wrap: wrap;
  }

  .photo-actions .btn,
  .photo-actions label.btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .ops-actions-grid {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-content {
    max-height: 94vh;
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .search-wrapper {
    width: 100%;
    min-width: 0;
  }

  .table-toolbar,
  .table-action-buttons {
    width: 100%;
  }

  .table-action-buttons .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .checkin-log-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mode-tabs-container {
    flex-wrap: wrap;
  }

  .mode-tab-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .toast {
    min-width: 0;
    width: 100%;
    padding: 0.85rem 1rem;
  }

  #view-kiosk > .glass-card {
    padding: 1rem !important;
  }

  #kiosk-confirm-screen .glass-card {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
  }

  #kiosk-confirm-avatar {
    margin: 0 auto;
  }
}

@media (max-width: 380px) {
  .sidebar {
    width: 52px;
  }

  .main-content {
    width: calc(100% - 52px);
    margin-left: 52px;
    padding: 0.5rem;
  }

  .sidebar-menu a,
  .logout-btn {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .photo-actions .btn,
  .photo-actions label.btn,
  .table-action-buttons .btn,
  .mode-tab-btn {
    flex-basis: 100%;
  }
}


