:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --muted: #6b7280;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --border: #e5e7eb;
}

body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  padding: 2.25rem 2rem;
}
.auth-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.auth-card .subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.auth-card .btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}
.auth-card .btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* ---------- Admin shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #111827;
  color: #e5e7eb;
  padding: 1.25rem 0.75rem;
}
.admin-sidebar .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  padding: 0.5rem 0.75rem 1.25rem;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #cbd5e1;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 2px;
}
.admin-sidebar a:hover { background: #1f2937; color: #fff; }
.admin-sidebar a.active { background: var(--brand); color: #fff; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-content { padding: 1.5rem; }

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  height: 100%;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; }
.stat-card .stat-label { color: var(--muted); font-size: 0.82rem; }

.card-panel {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.badge-status-active_gym { background: #dbeafe; color: #1e40af; }
.badge-status-completed { background: #dcfce7; color: #166534; }
.badge-status-not_checked_in { background: #f3f4f6; color: #4b5563; }
.badge-status-rejected { background: #fee2e2; color: #991b1b; }

.table-scroll { overflow-x: auto; }

/* ---------- Employee mobile-first ---------- */
.employee-wrap {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
}
.employee-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 1.5rem 1.25rem 2rem;
  border-radius: 0 0 20px 20px;
}
.employee-content { padding: 1.25rem; margin-top: -1.25rem; }

.gym-card, .status-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.location-status {
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
  background: #fafafa;
}
.location-status.state-verifying { background: #eff6ff; border-color: #bfdbfe; }
.location-status.state-verified { background: #f0fdf4; border-color: #bbf7d0; }
.location-status.state-error { background: #fef2f2; border-color: #fecaca; }

.btn-xl {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 12px;
}

.status-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-pill.at-gym { background: #dbeafe; color: #1e40af; }
.status-pill.completed { background: #dcfce7; color: #166534; }
.status-pill.not-checked-in { background: #f3f4f6; color: #4b5563; }
.status-pill.unavailable { background: #fee2e2; color: #991b1b; }

.spinner-inline {
  width: 1rem; height: 1rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

@media (max-width: 768px) {
  .admin-sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 1030; transition: left .2s; }
  .admin-sidebar.open { left: 0; }
  .admin-content { padding: 1rem; }
}
