@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  --luxury-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  --surface: #ffffff;
  --bg-main: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-light: rgba(226, 232, 240, 0.8);
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.1), 0 10px 15px -5px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 8px 25px rgba(37, 99, 235, 0.25);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
}

* {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Lao', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(241, 245, 249, 0.8) 0px, transparent 100%);
  background-attachment: fixed;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==============================================================================
   Top Navigation App Bar
   ============================================================================== */
.navbar-app {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
  z-index: 1030;
}
.navbar-app .brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

/* ==============================================================================
   Luxury Cards & Containers
   ============================================================================== */
.card-luxury {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}
.card-luxury:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(203, 213, 225, 0.9);
}

.card-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ==============================================================================
   Digital Clock Card
   ============================================================================== */
.clock-card {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.clock-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(37, 99, 235, 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.clock-time {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-variant-numeric: tabular-nums;
  margin: 0.2rem 0;
}
.clock-date {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.5);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==============================================================================
   Mobile Punch Buttons (Luxury Touch Cards)
   ============================================================================== */
.punch-card-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.1rem 0.8rem;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.punch-card-btn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.punch-card-btn.in-btn {
  border-top: 4px solid #10b981;
}
.punch-card-btn.out-btn {
  border-top: 4px solid #f59e0b;
}
.punch-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.6rem;
  font-size: 1.3rem;
  transition: transform 0.2s;
}
.in-btn .punch-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.out-btn .punch-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.punch-card-btn:active .punch-icon {
  transform: scale(1.1);
}
.punch-label {
  font-weight: 700;
  font-size: 1rem;
  color: #1e293b;
  margin-bottom: 0.15rem;
}
.punch-time {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}
.punch-done-badge {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
}

/* ==============================================================================
   Mobile Bottom Navigation Bar
   ============================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.4rem 0.5rem calc(env(safe-area-inset-bottom, 0px) + 0.4rem);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1040;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05);
}
.bottom-nav-item {
  flex: 1;
  text-align: center;
  background: none;
  border: none;
  padding: 0.35rem 0.2rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.bottom-nav-item .nav-icon {
  font-size: 1.35rem;
  transition: transform 0.2s, color 0.2s;
  line-height: 1;
}
.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item.active .nav-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.3));
}
.bottom-nav-item:active {
  transform: scale(0.92);
}

/* Padding to prevent content from hiding behind bottom nav */
.has-bottom-nav {
  padding-bottom: 90px !important;
}

/* ==============================================================================
   Luxury Form Controls & Inputs
   ============================================================================== */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  background-color: #ffffff;
  color: #0f172a;
  transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}
.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 0.35rem;
}

/* ==============================================================================
   Luxury Buttons
   ============================================================================== */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==============================================================================
   Mobile Table & Lists Style
   ============================================================================== */
.table-luxury {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.table-luxury thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.table-luxury tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-size: 0.9rem;
  vertical-align: middle;
}
.table-luxury tbody tr:last-child td {
  border-bottom: none;
}
.table-luxury tbody tr:hover {
  background-color: #f8fafc;
}

/* ==============================================================================
   Badges (Luxury Style)
   ============================================================================== */
.badge-luxury {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
}

/* ==============================================================================
   Camera Card (Selfie Modal)
   ============================================================================== */
.camera-view-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000000;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}
.camera-view-container video {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}
.camera-overlay-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 280px;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 50% 50% 45% 45%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

/* ==============================================================================
   Admin Horizontal Tabs on Mobile
   ============================================================================== */
.admin-scroll-tabs {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-scroll-tabs::-webkit-scrollbar {
  display: none;
}
.admin-scroll-tabs .nav-link {
  flex: 0 0 auto;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 2rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.admin-scroll-tabs .nav-link.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: var(--shadow-glow);
}

/* ==============================================================================
   Stat Metric Cards
   ============================================================================== */
.stat-pill-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}
.stat-pill-num {
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
