/* ==========================================================================
   SCLC DTR System v1.3.0 — Modern Mobile-Native Design System (Light & Dark)
   ========================================================================== */

:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #172554;
  --accent: #0ea5e9;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --success-text: #065f46;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --warning-text: #92400e;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --danger-text: #991b1b;
  --prayer: #8b5cf6;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-variant: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --input-readonly-bg: #f1f5f9;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 150ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-smooth: 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #0f172a;
    --accent: #38bdf8;
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.14);
    --success-text: #6ee7b7;
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --warning-text: #fcd34d;
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --danger-text: #fca5a5;

    --bg: #0b1120;
    --surface: #131c31;
    --surface-elevated: #1b2742;
    --surface-variant: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #27354f;
    --input-readonly-bg: #1e293b;

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --primary: #2563eb;
  --primary-light: #60a5fa;
  --primary-dark: #0f172a;
  --accent: #38bdf8;
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.14);
  --success-text: #6ee7b7;
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --warning-text: #fcd34d;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --danger-text: #fca5a5;

  --bg: #0b1120;
  --surface: #131c31;
  --surface-elevated: #1b2742;
  --surface-variant: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #27354f;
  --input-readonly-bg: #1e293b;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(88px + var(--safe-bottom));
  user-select: none;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

button, input, select, textarea {
  font-family: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
  color: #ffffff;
  padding: calc(14px + var(--safe-top)) 16px 18px;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo-badge {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.app-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text h1 {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.15;
}

.brand-text p {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
}

.status-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pill {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.pill-online {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.pill-offline {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.pill-sync-status {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.pill-sync-status:active {
  transform: scale(0.96);
}

.header-clock-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-time {
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}

.live-date {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.88);
  text-align: right;
  font-weight: 600;
}

/* Alarm & Warning Banners */
.alarm-banner {
  display: none;
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
  color: #ffffff;
  padding: 12px 16px;
  margin: 12px 16px 0;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  animation: pulse-border 1.8s infinite;
  align-items: center;
  justify-content: space-between;
  will-change: transform;
}

.alarm-banner.active {
  display: flex;
}

@keyframes pulse-border {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.008); }
}

.alarm-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alarm-icon {
  font-size: 1.5rem;
  animation: ring 0.5s ease infinite alternate;
}

@keyframes ring {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(10deg); }
}

.alarm-title {
  font-weight: 800;
  font-size: 0.92rem;
}

.alarm-sub {
  font-size: 0.78rem;
  opacity: 0.92;
}

.btn-dismiss-alarm {
  background: rgba(255, 255, 255, 0.24);
  border: none;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.btn-dismiss-alarm:active {
  transform: scale(0.95);
}

/* User Profile Banner */
.profile-bar {
  margin: 14px 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar-circle {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.profile-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pos {
  font-size: 0.76rem;
  color: var(--primary-light);
  font-weight: 600;
}

.btn-profile-edit {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.btn-profile-edit:active {
  transform: scale(0.96);
}

/* Content Container */
.container {
  padding: 14px 16px;
  max-width: 680px;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-tag {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.badge-10m {
  background: var(--danger-soft);
  color: var(--danger-text);
}

/* Hero Attendance Status & 3-Tier Geofence Pills */
.hero-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

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

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface-variant);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.hero-status-pill.timed-in {
  background: var(--success-soft);
  color: var(--success-text);
  border-color: var(--success);
}

.hero-status-pill.timed-out {
  background: var(--surface-variant);
  color: var(--text-muted);
  border-color: var(--border);
}

.zone-pills-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.zone-pill {
  background: var(--surface-variant);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.zone-pill-title {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.zone-pill-radius {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
}

.zone-pill-dist {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.zone-pill.active-inside {
  background: var(--success-soft);
  border-color: var(--success);
}

.zone-pill.active-inside .zone-pill-title,
.zone-pill.active-inside .zone-pill-dist {
  color: var(--success-text);
}

.zone-pill.active-outside {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.zone-pill.active-outside .zone-pill-title,
.zone-pill.active-outside .zone-pill-dist {
  color: var(--danger-text);
}

/* Leaflet Map & Geofence */
#map {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  z-index: 10;
  background: var(--surface-variant);
}

.geofence-status-card {
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.geofence-inside {
  background: var(--success-soft);
  border: 1.5px solid var(--success);
  color: var(--success-text);
}

.geofence-outside {
  background: var(--danger-soft);
  border: 1.5px solid var(--danger);
  color: var(--danger-text);
}

.geofence-detecting {
  background: var(--warning-soft);
  border: 1.5px solid var(--warning);
  color: var(--warning-text);
}

.distance-highlight {
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.geofence-instructions {
  font-size: 0.76rem;
  margin-top: 4px;
  opacity: 0.9;
}

/* Action Punch Buttons */
.punch-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.btn-punch {
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  will-change: transform;
}

.btn-punch:active {
  transform: scale(0.98);
}

.btn-punch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.btn-time-in {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
}

.btn-prayer {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
  color: #ffffff;
}

.btn-time-out,
.btn-pm-out {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
  color: #ffffff;
}

.btn-outside-reason {
  grid-column: span 2;
  background: var(--surface-variant);
  border: 1.5px dashed var(--danger);
  color: var(--danger-text);
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.btn-outside-reason:active {
  transform: scale(0.98);
}

.btn-itinerary-advance,
.btn-eterinary-advance {
  grid-column: span 2;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.btn-itinerary-advance:active,
.btn-eterinary-advance:active {
  transform: scale(0.98);
}

/* Validation Method Selector */
.auth-method-selector {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  background: var(--surface-variant);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.auth-method-tab {
  flex: 1;
  text-align: center;
  padding: 9px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: transform var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.auth-method-tab:active {
  transform: scale(0.98);
}

.auth-method-tab.active {
  background: var(--surface-elevated);
  color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

/* Filter / Search Controls */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-bar .form-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.filter-bar .form-select {
  width: auto;
  min-width: 112px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, var(--surface-variant) 25%, var(--border) 50%, var(--surface-variant) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.full { width: 100%; margin-bottom: 0; }

/* Vacation Leave Cards */
.leave-item-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}

.leave-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.leave-dates {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
}

.badge-approved {
  background: var(--success-soft);
  color: var(--success-text);
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

.badge-pending {
  background: var(--warning-soft);
  color: var(--warning-text);
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

.badge-disapproved {
  background: var(--danger-soft);
  color: var(--danger-text);
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

.leave-purpose {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 6px;
}

.leave-remarks-box {
  background: var(--surface-variant);
  border-left: 3px solid var(--primary-light);
  padding: 7px 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 6px;
}

.leave-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-change-date {
  font-size: 0.75rem;
  padding: 5px 11px;
  background: var(--surface-variant);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--primary-light);
  font-weight: 700;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(10px + var(--safe-bottom));
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.nav-item:active {
  transform: scale(0.94);
}

.nav-item.active {
  color: var(--primary-light);
}

.nav-icon {
  font-size: 1.25rem;
  line-height: 1.2;
}

/* Modal z-index above auth gates (5000), below GPS gate (999999) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  animation: modal-slide-up 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

@media (max-width: 600px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content {
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    padding: 18px 18px calc(22px + var(--safe-bottom));
  }
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.modal-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
}

.btn-close-modal {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Form Inputs */
.form-group {
  margin-bottom: 13px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition-fast);
}

.form-input[readonly] {
  background: var(--input-readonly-bg);
  color: var(--text-muted);
}

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

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

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

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-primary {
  flex: 1;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

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

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  flex: 1;
  background: var(--surface-variant);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* History Logs */
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.log-time-badge {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
}

.log-tag-inside {
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
}

.log-tag-outside {
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Non-Blocking Toast Notifications */
.toast-container {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-success { border-left: 4px solid #10b981; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-error { border-left: 4px solid #ef4444; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Info Callouts */
.info-callout {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.danger-callout {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--danger-text);
  margin-bottom: 12px;
}

/* Fullscreen Device GPS / Location Access Gate */
body.gps-gate-open {
  overflow: hidden;
  touch-action: none;
}

.gps-gate-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #0d1321;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(28px + var(--safe-top)) 26px calc(28px + var(--safe-bottom));
  text-align: center;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.gps-gate-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gps-gate-icon-circle {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #1b2434;
  border: 2.5px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.14);
}

.gps-gate-title {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.gps-gate-message {
  color: #8896ab;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 34px 0;
  max-width: 330px;
}

.gps-gate-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gps-gate-btn-primary {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.gps-gate-btn-primary:active {
  transform: scale(0.985);
  background: #1d4ed8;
}

.gps-gate-btn-exit {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  background: transparent;
  border: 1.5px solid rgba(148, 163, 184, 0.34);
  color: #cbd5e1;
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.gps-gate-btn-exit:active {
  transform: scale(0.985);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.55);
}

/* Auth & Pending Approval Gates */
body.auth-gate-open {
  overflow: hidden;
}

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(20px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  overflow-y: auto;
}

.auth-gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-gate-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--border);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.auth-gate-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-gate-title {
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-gate-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

.btn-google-signin {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-google-signin:active {
  transform: scale(0.985);
}

.btn-google-signin:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-admin-link {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
}

.pending-badge-pill {
  background: var(--warning-soft);
  color: var(--warning-text);
  border: 1px solid var(--warning);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

/* Schedule Banner in Attendance Card */
.schedule-summary-banner {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* Admin Sub-Navigation & Account / Schedule Controls */
.admin-subnav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface-variant);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.admin-subtab {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.admin-subtab.active {
  background: var(--surface-elevated);
  color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.admin-pending-pill {
  background: var(--danger);
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.acct-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.acct-stat-box {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
}

.acct-stat-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-light);
}

.acct-stat-box.pending .acct-stat-num { color: var(--warning); }
.acct-stat-box.approved .acct-stat-num { color: var(--success); }
.acct-stat-box.suspended .acct-stat-num { color: var(--danger); }

.acct-stat-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.acct-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.acct-filter-pill {
  background: var(--surface-variant);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.acct-filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.acct-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}

.acct-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-acct-sm {
  flex: 1;
  min-width: 90px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-variant);
  color: var(--text);
}

.btn-acct-sm.approve {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.btn-acct-sm.danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-text);
}

.sched-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.workdays-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.workday-pill {
  flex: 1;
  min-width: 40px;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.workday-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background-color var(--transition-fast);
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}
