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

:root {
  --bg-main: #090d16;
  --bg-card: rgba(16, 23, 38, 0.85);
  --bg-card-hover: rgba(23, 32, 54, 0.95);
  --bg-surface: #111827;
  --bg-surface-elevated: #1f293d;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-glow: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  --success-bg: rgba(16, 185, 129, 0.12);
  
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --danger-bg: rgba(239, 68, 68, 0.12);
  
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.4);
  --warning-bg: rgba(245, 158, 11, 0.12);
  
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
#app {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

@media (min-width: 768px) {
  #app {
    padding: 2rem;
  }
}

/* Glass Card Base */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* Top App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #ffffff 40%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-left: 0.5rem;
  text-transform: uppercase;
}

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

.user-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.user-tag .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.btn-icon-subtle {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-subtle:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-outline {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-danger-outline:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* ========================================================
   PIN LOCK SCREEN
   ======================================================== */
.lock-screen-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 1rem;
}

.lock-card {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--primary), var(--success));
}

.lock-avatar {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-glass-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 1.75rem;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.lock-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.lock-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

/* Role Selector Tabs on Lock Screen */
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-glass);
}

.role-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.role-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.role-tab.active.admin-mode {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
}

/* PIN Indicator Dots */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  height: 24px;
  align-items: center;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-dot.filled {
  background: var(--cyan);
  border-color: var(--cyan);
  transform: scale(1.2);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.pin-dots.error {
  animation: shake 0.4s ease-in-out;
}

.pin-dots.error .pin-dot {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger-glow);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Keypad Grid */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 280px;
  margin: 0 auto 1.5rem;
}

.key-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  height: 56px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.key-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.key-btn:active {
  transform: translateY(1px) scale(0.96);
  background: var(--primary);
}

.key-btn.action-btn {
  background: transparent;
  border-color: transparent;
  font-size: 1rem;
  color: var(--text-muted);
}

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



/* ========================================================
   USER DASHBOARD
   ======================================================== */
.user-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .user-layout {
    grid-template-columns: 380px 1fr;
  }
}

/* Left Column: Action Card & Geofence */
.punch-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-profile-info h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
}

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

/* Big Glowing Action Punch Button */
.punch-action-area {
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.punch-main-btn {
  width: 175px;
  height: 175px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  position: relative;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.punch-main-btn::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  animation: rotateSlow 20s linear infinite;
  pointer-events: none;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.punch-main-btn.can-punch-in {
  background: radial-gradient(circle at 30% 30%, #34d399, #059669);
  border-color: #6ee7b7;
  box-shadow: 0 0 35px var(--success-glow), inset 0 2px 10px rgba(255, 255, 255, 0.5);
}

.punch-main-btn.can-punch-in:hover {
  transform: scale(1.04);
  box-shadow: 0 0 45px rgba(16, 185, 129, 0.6);
}

.punch-main-btn.active-punch-out {
  background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
  border-color: #fca5a5;
  box-shadow: 0 0 35px var(--danger-glow), inset 0 2px 10px rgba(255, 255, 255, 0.5);
  animation: pulseSession 2.5s infinite;
}

.punch-main-btn.active-punch-out:hover {
  transform: scale(1.04);
  box-shadow: 0 0 45px rgba(239, 68, 68, 0.6);
}

.punch-main-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

@keyframes pulseSession {
  0% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 45px rgba(239, 68, 68, 0.8), 0 0 8px #fff; }
  100% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.4); }
}

.punch-btn-icon {
  font-size: 2.25rem;
}

.punch-btn-label {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.punch-btn-sub {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Active Session Live Timer Box */
.live-session-tracker {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-glow);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.live-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.4rem;
}

.live-timer-clock {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.live-timer-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Geofence Proximity Widget */
.geofence-radar-box {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  border: 1px solid var(--border-glass);
}

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

.radar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.geo-status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.geo-status-pill.inside {
  background: var(--success-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.geo-status-pill.outside {
  background: var(--danger-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.geo-status-pill.locating {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.geo-status-pill.error {
  background: var(--danger-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  cursor: pointer;
}

.geo-status-pill.warning {
  background: var(--warning-bg);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.geo-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.6rem;
  width: 100%;
  justify-content: center;
  transition: var(--transition-fast);
}

.geo-retry-btn:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

.radar-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.radar-stat {
  background: var(--bg-surface-elevated);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
}

.radar-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.radar-stat-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}



/* Right Column: Mini Map & User History */
.user-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* User Quick Summary Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-icon.indigo { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.18); color: #22d3ee; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

.stat-data .stat-val {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-data .stat-label {
  font-size: 0.775rem;
  color: var(--text-muted);
}



/* Visits List & History Table */
.history-card {
  padding: 1.5rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

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

.custom-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.custom-table th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.custom-table th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.status-badge.in-progress {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.status-badge.completed {
  background: var(--success-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hours-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

/* ========================================================
   ADMIN DASHBOARD
   ======================================================== */
.admin-tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.admin-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

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

.admin-nav-btn.active {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Admin Tab Content */
.admin-tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.admin-tab-pane.active {
  display: block;
}

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

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-surface);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-control {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Daily Aggregate Card */
.daily-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.daily-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: var(--transition-normal);
}

.daily-card:hover {
  border-color: var(--border-glass-glow);
  transform: translateY(-2px);
}

.daily-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.5rem;
}

.daily-card-date {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
}

.daily-hours-total {
  font-size: 1.15rem;
  font-weight: 800;
  color: #34d399;
}

.daily-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.daily-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
}

/* Admin Settings Grid */
.admin-settings-layout {
  max-width: 680px;
  margin: 0 auto;
}

.form-card {
  padding: 1.75rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

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

/* Modal System */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10000;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  position: relative;
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-close:hover { color: white; }

/* Toast Notifications */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  color: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  animation: toastSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--cyan); }
.toast.warning { border-left: 4px solid var(--warning); }

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

/* ========================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ======================================================== */

@media (max-width: 768px) {
  #app {
    padding: 0.75rem;
  }

  .app-header {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-badge {
    display: none; /* Hide badge on very small screens to save space */
  }

  .header-actions {
    gap: 0.5rem;
  }

  .user-tag {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
  }

  .btn-danger-outline {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
  }

  /* Lock Screen Mobile */
  .lock-screen-wrapper {
    min-height: calc(100vh - 100px);
    padding: 0.5rem;
  }

  .lock-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-md);
  }

  .lock-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .lock-title {
    font-size: 1.3rem;
  }

  .lock-subtitle {
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
  }

  .keypad {
    gap: 0.5rem;
    max-width: 260px;
  }

  .key-btn {
    height: 50px;
    font-size: 1.25rem;
    border-radius: var(--radius-sm);
  }

  /* Dashboard Cards Mobile */
  .user-layout {
    gap: 1rem;
  }

  .punch-card {
    padding: 1.25rem 1rem;
    gap: 1rem;
  }

  .punch-action-area {
    padding: 1rem 0;
  }

  .punch-main-btn {
    width: 155px;
    height: 155px;
  }

  .punch-btn-icon {
    font-size: 1.85rem;
  }

  .punch-btn-label {
    font-size: 1rem;
  }

  .live-timer-clock {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.85rem 0.75rem;
    gap: 0.6rem;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .stat-data .stat-val {
    font-size: 1.2rem;
  }

  .stat-data .stat-label {
    font-size: 0.7rem;
  }

  .history-card {
    padding: 1rem 0.85rem;
  }

  .history-header {
    margin-bottom: 0.85rem;
  }

  .section-title {
    font-size: 1.05rem;
  }

  /* Admin Dashboard Mobile */
  .admin-tabs-nav {
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-nav-btn {
    font-size: 0.825rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
  }

  .filter-bar {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .filter-group select,
  .filter-group input,
  .filter-group button {
    width: 100%;
  }

  .filter-bar > div:last-child {
    width: 100%;
  }

  .filter-bar > div:last-child button {
    width: 100%;
    justify-content: center;
  }

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

  .form-card {
    padding: 1.25rem 1rem;
  }

  /* Modals Mobile */
  .modal-box {
    max-width: 95vw;
    padding: 1.35rem 1.1rem;
    border-radius: var(--radius-md);
    max-height: 90vh;
    overflow-y: auto;
  }

  /* iOS Auto-zoom prevention: ensure 16px minimum font on inputs */
  .form-control,
  select.form-control,
  input.form-control {
    font-size: 16px;
  }

  /* Toast Notification Mobile */
  #toastContainer {
    left: 12px;
    right: 12px;
    bottom: 16px;
    width: auto;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
    width: 100%;
    font-size: 0.825rem;
    padding: 0.75rem 1rem;
  }
}

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

  .radar-details {
    grid-template-columns: 1fr;
  }

  .punch-main-btn {
    width: 140px;
    height: 140px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}
