/* Modern UI CSS Variables & Reset */
:root {
  --font-main: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Accessible Light Palette (High Contrast & Clear for Elderly Users) */
  --bg-color: #f1f5f9;          /* Slate 100 (Comfortable soft gray background) */
  --bg-card: #ffffff;           /* Pure white card backgrounds */
  --bg-input: #f8fafc;          /* Slate 50 (Slightly lighter gray background for inputs) */
  --text-main: #0f172a;         /* Slate 900 (High contrast dark charcoal) */
  --text-muted: #334155;        /* Slate 700 (Very dark slate gray for maximum text accessibility) */
  
  --primary: #1d4ed8;           /* Blue 700 (High visibility royal blue) */
  --primary-hover: #1e40af;     /* Blue 800 */
  --success: #047857;           /* Emerald 700 (Rich green) */
  --danger: #b91c1c;            /* Red 700 (High-contrast red) */
  
  --border-color: #cbd5e1;      /* Slate 300 (Clearly defined borders) */
  --bg-hover: rgba(15, 23, 42, 0.05); /* Soft dark-slate blend for hovers */
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  
  --shadow-lg: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05), 0 10px 15px -3px rgba(15, 23, 42, 0.03);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* App Container (Mobile) */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Helper Utilities */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.btn-block { width: 100% !important; }

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-employee {
  background-color: rgba(29, 78, 216, 0.08);
  color: var(--primary);
  border: 1px solid rgba(29, 78, 216, 0.25);
}
.badge-admin {
  background-color: rgba(4, 120, 87, 0.08);
  color: var(--success);
  border: 1px solid rgba(4, 120, 87, 0.25);
}

/* ==========================================================================
   ADMIN LAYOUT (SIDEBAR & MAIN CONTENT)
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Navigasi */
.sidebar {
  width: 280px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo i {
  color: var(--primary);
  font-size: 1.5rem;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600; /* Bold sidebar text for elder readability */
  font-size: 1rem;   /* Larger font for readability */
  transition: all var(--transition-fast);
}

.nav-item i {
  font-size: 1.25rem;
  transition: color var(--transition-fast);
}

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

.nav-item.active {
  background-color: rgba(29, 78, 216, 0.1);
  color: var(--primary);
  font-weight: 700;
}
.nav-item.active i {
  color: var(--primary);
}

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background-color: var(--bg-input);
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
  flex-shrink: 0;
}

.admin-info {
  min-width: 0;
}

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

.admin-info span {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.sidebar-logout {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239, 68, 68, 0.15);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-logout:hover {
  background-color: var(--danger);
  color: #ffffff;
}

/* Area Konten Utama */
.main-content {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.content-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.content-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.live-indicator i {
  font-size: 0.55rem;
  animation: pulse 1.5s infinite;
}

/* Grid Filter Laporan */
.report-filter-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filter-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.filter-actions-area {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  margin-top: 0.5rem;
}

/* ==========================================================================
   MODULE: LOGIN PAGE
   ========================================================================== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 1.5rem;
}

.login-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  border: 1.5px solid var(--border-color);
  backdrop-filter: blur(10px);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--text-main);
  font-size: 1.75rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.login-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 0.25rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Alert Notification */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 0.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

.input-container i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-container input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background-color: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.input-container input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.input-container input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.input-container input:focus + i,
.input-container:focus-within i {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
  background-color: #059669;
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:disabled {
  background-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   MODULE: EMPLOYEE ATTENDANCE (MOBILE VIEW & CHOOSE MENU)
   ========================================================================== */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  margin-bottom: 1.25rem;
  position: sticky;
  top: 1.5rem;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

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

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-input);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1.5px solid rgba(99, 102, 241, 0.3);
}

.profile-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.btn-logout {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.btn-logout:hover {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}
.btn-install:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-install:active {
  transform: translateY(0);
}


/* Pilihan Awal Layar Karyawan */
.selection-menu {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slideUp 0.4s ease-out;
}

.selection-title {
  text-align: center;
}

.selection-title h4 {
  font-size: 1.35rem; /* Larger title for elderly users */
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.selection-title p {
  font-size: 0.95rem; /* Larger text for elderly users */
  color: var(--text-muted);
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-menu-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-menu-text {
  text-align: left;
  flex: 1;
}

.btn-menu-text h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-menu-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.btn-menu-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

/* Modifikasi Detail Menu In, Out, History */
.btn-menu-in {
  border-left: 5px solid var(--success) !important; /* Thick contrast border */
}
.btn-menu-in .btn-menu-icon {
  background-color: rgba(4, 120, 87, 0.08);
  color: var(--success);
}
.btn-menu-in:hover {
  background-color: rgba(4, 120, 87, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(4, 120, 87, 0.08);
}
.btn-menu-in:hover .btn-menu-arrow {
  color: var(--success);
  transform: translateX(3px);
}

.btn-menu-out {
  border-left: 5px solid var(--danger) !important; /* Thick contrast border */
}
.btn-menu-out .btn-menu-icon {
  background-color: rgba(185, 28, 28, 0.08);
  color: var(--danger);
}
.btn-menu-out:hover {
  background-color: rgba(185, 28, 28, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(185, 28, 28, 0.08);
}
.btn-menu-out:hover .btn-menu-arrow {
  color: var(--danger);
  transform: translateX(3px);
}

.btn-menu-history {
  border-left: 5px solid var(--primary) !important; /* Thick contrast border */
}
.btn-menu-history .btn-menu-icon {
  background-color: rgba(29, 78, 216, 0.08);
  color: var(--primary);
}
.btn-menu-history:hover {
  background-color: rgba(29, 78, 216, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.08);
}
.btn-menu-history:hover .btn-menu-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

.btn-menu-disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  pointer-events: none;
  background-color: var(--bg-hover) !important;
  border-left-color: var(--text-muted) !important;
}
.btn-menu-disabled .btn-menu-icon {
  background-color: var(--border-color) !important;
  color: var(--text-muted) !important;
}
.btn-menu-disabled .btn-menu-arrow {
  color: var(--border-color) !important;
}
.btn-menu-disabled .btn-menu-text p.disabled-reason {
  color: var(--danger) !important;
  font-weight: 500;
}

/* Halaman Kamera Absen / Panel Riwayat */
.attendance-card,
.history-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeIn 0.4s ease-out;
}

.card-title-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.btn-back-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem; /* Larger font size */
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem; /* Larger tap targets */
  border-radius: 6px;
  background-color: var(--bg-hover);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.btn-back-menu:hover {
  color: var(--text-main);
  background-color: rgba(15, 23, 42, 0.1);
}

.card-header h4,
.history-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
}
.card-header p,
.history-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Carian Tanggal Riwayat */
.search-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.search-container label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: left;
}
.input-search-date {
  padding-right: 1.5rem !important; /* Spasi aman untuk date picker default */
}

/* Kamera Section */
.camera-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  position: relative;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.15);
}

.camera-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.camera-container video,
.camera-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.85); /* High contrast light overlay */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
  color: var(--text-muted);
  font-size: 1rem;
}

.camera-overlay i {
  font-size: 2rem;
  color: var(--primary);
}

/* GPS Section */
.gps-container {
  background-color: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  border: 1.5px solid var(--border-color);
}

.gps-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: rgba(29, 78, 216, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.gps-info {
  flex: 1;
}

.gps-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.gps-status-text {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-top: 0.15rem;
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem; /* Larger font */
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all var(--transition-fast);
}
.btn-retry:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   MODULE: EMPLOYEE ATTENDANCE HISTORY LIST
   ========================================================================== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 360px; /* Diperbesar agar melihat history lebih nyaman */
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Webkit Scrollbar */
.history-list::-webkit-scrollbar {
  width: 6px;
}
.history-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}
.history-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 99px;
}

.history-empty,
.history-search-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.history-empty i,
.history-search-empty i {
  font-size: 2.5rem;
  color: var(--border-color);
  margin-bottom: 0.5rem;
  display: block;
}

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

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

.history-time-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.history-time {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.history-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-thumb-container {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.history-thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.history-thumb-zoom {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(29, 78, 216, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.history-thumb-container:hover img {
  transform: scale(1.15);
}
.history-thumb-container:hover .history-thumb-zoom {
  opacity: 1;
}

.history-btn-maps {
  background-color: var(--bg-card);
  color: var(--text-muted);
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}
.history-btn-maps:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ==========================================================================
   MODULE: ADMIN DASHBOARD
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: rgba(4, 120, 87, 0.08);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-data {
  flex: 1;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.metric-val {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Tabel Monitoring */
.table-container {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.table-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}
.table-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

th {
  background-color: #f8fafc;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

tr:hover td {
  background-color: var(--bg-hover);
}

/* Status Kosong */
.empty-state {
  text-align: center;
  padding: 4rem 2rem !important;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 3rem;
  color: var(--bg-input);
  margin-bottom: 1rem;
}

/* Cell-cell khusus */
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
}
.user-fullname {
  font-weight: 600;
  font-size: 0.9rem;
}
.user-username {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.time-cell {
  display: flex;
  flex-direction: column;
}
.date-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Thumbnail Foto Absen */
.photo-thumbnail-container {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  vertical-align: middle;
}

.img-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(29, 78, 216, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: #ffffff;
  font-size: 0.85rem;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.photo-thumbnail-container:hover .img-thumbnail {
  transform: scale(1.15);
}
.photo-thumbnail-container:hover .zoom-overlay {
  opacity: 1;
}

.gps-cell span {
  font-family: monospace;
}

.btn-maps {
  background-color: rgba(29, 78, 216, 0.08);
  color: var(--primary);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem; /* Larger font */
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(29, 78, 216, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}
.btn-maps:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ==========================================================================
   MODULE: PHOTO EXPAND MODAL
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(2, 6, 23, 0.85); /* Slate 950 alpha */
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-fast);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  color: var(--text-main);
  font-size: 2rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  z-index: 1010;
}
.modal-close:hover {
  color: var(--danger);
}

.modal-content-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  width: 90%;
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-content-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 3px solid #ffffff;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
}

.modal-caption-text {
  margin-top: 1rem;
  color: var(--text-main);
  font-size: 0.95rem;
  text-align: center;
}
