/* ==========================================================================
   LLOYD Supervisor Mobile App — Stylesheet
   Modern, Touch-First Mobile UX for iOS & Android
   ========================================================================== */

:root {
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-surface: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --border: #334155;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea, select {
  user-select: text;
}

body {
  font-family: var(--font-family);
  background-color: #020617;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow-x: hidden;
}

/* App Wrapper: Constrained to Phone Width on Desktop, 100% on Mobile */
.mobile-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  padding-bottom: calc(72px + var(--safe-bottom));
}

/* Header Bar */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: calc(12px + var(--safe-top)) 16px 12px 16px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-circle {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.1s, background 0.2s;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--bg-surface);
}

/* Date Switcher Bar */
.date-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.date-nav-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-main);
  border-radius: 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.date-nav-btn:active {
  background: var(--bg-surface);
}

.date-display-btn {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.date-display-btn span.day-pill {
  font-size: 0.72rem;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

/* Department Horizontal Scroll Pill Bar */
.dept-scroll-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dept-scroll-bar::-webkit-scrollbar {
  display: none;
}

.dept-chip {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.dept-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

/* Metric KPI Mini Badges */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px 12px 16px;
}

.metric-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}

.metric-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.metric-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}

.metric-pill.present .metric-val { color: var(--success); }
.metric-pill.half .metric-val { color: var(--warning); }
.metric-pill.absent .metric-val { color: var(--danger); }
.metric-pill.leave .metric-val { color: var(--purple); }

/* Quick Action Strip (Mark All Present) */
.action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px 16px;
  gap: 10px;
}

.batch-btn {
  flex: 1;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: transform 0.1s;
}

.batch-btn:active {
  transform: scale(0.97);
}

.search-input-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.search-input-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.82rem;
  width: 100%;
}

.search-input-box input::placeholder {
  color: #64748b;
}

/* Tab Views Container */
.tab-content {
  flex: 1;
  padding: 0 16px 16px 16px;
  display: none;
}

.tab-content.active {
  display: block;
}

/* Employee Attendance Cards List */
.emp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  transition: border-color 0.2s, transform 0.1s;
  position: relative;
}

.emp-card.marked-present { border-left: 4px solid var(--success); }
.emp-card.marked-half { border-left: 4px solid var(--warning); }
.emp-card.marked-absent { border-left: 4px solid var(--danger); }
.emp-card.marked-leave { border-left: 4px solid var(--purple); }
.emp-card.marked-off { border-left: 4px solid #64748b; }

.emp-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.emp-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  flex-shrink: 0;
}

.emp-info {
  flex: 1;
  min-width: 0;
}

.emp-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.emp-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-id-badge {
  font-size: 0.68rem;
  background: #334155;
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.emp-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-time-punch {
  font-size: 0.72rem;
  color: #38bdf8;
  margin-top: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 1-Tap Quick Status Buttons Group */
.quick-status-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #334155;
}

.status-tap-btn {
  padding: 8px 4px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.status-tap-btn:active {
  transform: scale(0.9);
}

.status-tap-btn.btn-p.active { background: #065f46; color: #34d399; border-color: #059669; }
.status-tap-btn.btn-hd.active { background: #78350f; color: #fcd34d; border-color: #d97706; }
.status-tap-btn.btn-a.active { background: #7f1d1d; color: #fca5a5; border-color: #dc2626; }
.status-tap-btn.btn-pl.active { background: #1e3a8a; color: #93c5fd; border-color: #2563eb; }
.status-tap-btn.btn-ul.active { background: #581c87; color: #d8b4fe; border-color: #9333ea; }
.status-tap-btn.btn-wo.active { background: #334155; color: #e2e8f0; border-color: #475569; }

/* Bottom Modal Slide-Up Sheet (Detail Punch) */
.sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sheet-backdrop.open {
  display: block;
  opacity: 1;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: #1e293b;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 16px 20px calc(24px + var(--safe-bottom)) 20px;
  z-index: 210;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: #475569;
  border-radius: 999px;
  margin: 0 auto 16px auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.sheet-close-btn {
  background: var(--bg-surface);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Form Groups in Sheet */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: #fff;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hours-calc-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.calc-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
}

.calc-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
  transition: transform 0.1s, background 0.2s;
}

.btn-primary:active {
  transform: scale(0.98);
  background: var(--primary-hover);
}

/* Bottom Tab Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px calc(8px + var(--safe-bottom)) 6px;
  z-index: 90;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  gap: 4px;
  padding: 4px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item .nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.nav-item.active {
  color: #38bdf8;
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Fullscreen Fast PIN Keypad Lock Screen */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #090d16;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lock-avatar {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4);
}

.lock-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.lock-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 24px;
}

/* PIN Indicator Dots */
.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #475569;
  transition: all 0.2s;
}

.pin-dot.filled {
  background: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
  transform: scale(1.15);
}

/* Numeric Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 280px;
  width: 100%;
}

.key-btn {
  width: 72px;
  height: 72px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.key-btn:active {
  background: #334155;
  transform: scale(0.92);
}

.key-btn.action {
  font-size: 1.1rem;
  background: transparent;
  border: none;
  color: #94a3b8;
}

.lock-help-link {
  margin-top: 24px;
  font-size: 0.82rem;
  color: #38bdf8;
  text-decoration: underline;
  cursor: pointer;
}

/* Toast Container */
.toast-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

.toast-box.show {
  display: block;
  opacity: 1;
}

.toast-box.success { border-color: var(--success); color: #34d399; }
.toast-box.error { border-color: var(--danger); color: #f87171; }
.toast-box.info { border-color: var(--primary); color: #38bdf8; }

/* Employee Directory Card Styles */
.emp-salary-tag {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.emp-salary-tag .salary-val {
  color: #34d399;
  font-weight: 700;
}

.emp-salary-tag .ot-val {
  color: #38bdf8;
  font-weight: 700;
}

.emp-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #334155;
}

.btn-card-action {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  background: #0f172a;
  color: #fff;
  transition: all 0.15s;
}

.btn-card-action:active {
  transform: scale(0.95);
}

.btn-card-action.edit {
  border-color: #0284c7;
  color: #38bdf8;
}

.btn-card-action.edit:active {
  background: #0369a1;
  color: #fff;
}

.btn-card-action.remove {
  border-color: #ef4444;
  color: #f87171;
}

.btn-card-action.remove:active {
  background: #dc2626;
  color: #fff;
}

.highlight-input {
  border: 1px solid #0284c7 !important;
  background: #0c192c !important;
  font-weight: 700 !important;
  color: #38bdf8 !important;
}

