/* ═══════════════════════════════════════════════════════════
   PT Capture v2 — Task & Accountability Platform
   iPhone-first, dark mode, glassmorphism
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(20, 20, 30, 0.85);
  --text-primary: #f0f0f5;
  --text-secondary: #8b8b9e;
  --text-muted: #5a5a6e;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --pink: #ec4899;
  --teal: #14b8a6;
  --purple: #8b5cf6;
  --gray: #6b7280;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 60px;
}

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background: var(--bg-primary);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.hidden { display: none !important; }

/* ═══════════ SCREENS ═══════════ */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-primary);
  padding-top: var(--safe-top);
}
.screen.active { display: flex; flex-direction: column; }

/* ═══════════ LOGIN SCREEN ═══════════ */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 24px;
  padding-bottom: calc(40px + var(--safe-bottom));
}
.login-logo {
  font-size: 56px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
.login-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}
.pin-dots {
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--text-muted);
  transition: all 0.2s;
}
.dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.dot.dot-extra { display: none; }
.pin-dots.six-digit .dot-extra { display: block; }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 280px;
  width: 100%;
}
.pin-key {
  height: 64px;
  border-radius: var(--radius);
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-user-select: none;
}
.pin-key:active { transform: scale(0.92); background: var(--bg-card-hover); }
.pin-key-empty { background: transparent; cursor: default; }
.pin-key-delete { font-size: 20px; }
.pin-error {
  color: var(--red);
  font-size: 14px;
  min-height: 20px;
  margin-top: 16px;
  text-align: center;
}

/* ═══════════ HEADER ═══════════ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.icon-btn:active { transform: scale(0.95); }

/* ═══════════ DASHBOARD ═══════════ */
.dashboard-content {
  padding: 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.streak-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: streakGlow 2s ease-in-out infinite;
}
@keyframes streakGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.1); }
  50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.25); }
}
.streak-fire { font-size: 28px; }
.streak-count {
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--orange), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.streak-label { color: var(--text-secondary); font-size: 15px; font-weight: 500; }

.clock-status-bar {
  background: var(--green-bg);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--green);
}
.clock-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.dash-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dash-card:active { transform: scale(0.96); }
.dash-card-tasks { border-color: rgba(99, 102, 241, 0.3); }
.dash-card-products { border-color: rgba(236, 72, 153, 0.3); }
.dash-card-icon { font-size: 40px; }
.dash-card-title { font-size: 16px; font-weight: 700; }
.dash-card-stat { font-size: 13px; color: var(--text-secondary); }
.dash-urgent { color: var(--red); font-size: 12px; font-weight: 600; }

/* Score Ring */
.score-ring-container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 0;
}
.score-ring {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: var(--bg-card); stroke-width: 8; }
.score-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}
.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-pct { font-size: 22px; font-weight: 800; }
.score-details { display: flex; flex-direction: column; gap: 6px; }
.score-detail { color: var(--text-secondary); font-size: 14px; }

.scorecard-btn {
  width: 100%;
  background: var(--bg-card) !important;
  border: 1px solid var(--bg-card-border) !important;
}

/* Admin Nav */
.admin-nav-section { padding-top: 8px; }
.admin-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.admin-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.admin-nav-btn:active { transform: scale(0.96); }
.admin-nav-btn span { font-size: 18px; }

/* ═══════════ TASK LIST ═══════════ */
.task-filter-bar { padding: 0 16px; }
.type-filter-bar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.type-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.2s;
}
.type-pill.active { color: #fff; }

.task-progress {
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.task-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.task-list {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: calc(16px + var(--safe-bottom));
}
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.task-card:active { transform: scale(0.98); }
.task-card.priority-1 { border-left: 3px solid var(--red); }
.task-card.priority-2 { border-left: 3px solid var(--blue); }
.task-card.priority-3 { border-left: 3px solid var(--gray); }
.task-card.overdue { animation: overdueFlash 2s ease-in-out infinite; }
@keyframes overdueFlash {
  0%, 100% { border-color: var(--bg-card-border); border-left-color: var(--red); }
  50% { border-color: rgba(239, 68, 68, 0.3); border-left-color: var(--red); }
}
.task-card.complete {
  opacity: 0.5;
  border-left-color: var(--green);
}
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.task-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
}
.task-card-title.done { text-decoration: line-through; color: var(--text-muted); }
.task-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-card);
  white-space: nowrap;
}
.type-badge-lg {
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 8px;
}
.task-due-tag {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.task-due-tag.overdue { color: var(--red); font-weight: 600; }
.task-assigned-tag {
  font-size: 11px;
  color: var(--text-muted);
}
.task-meta-icons {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════════ FOCUS MODE ═══════════ */
.focus-header { justify-content: space-between; }
.focus-timer-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
}
.timer-icon { font-size: 14px; }
.focus-timer {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.focus-content {
  flex: 1;
  padding: 16px;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.focus-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}
.focus-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}
.focus-progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.focus-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.3;
}
.focus-description {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}
.focus-estimate {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  width: fit-content;
}
.focus-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--bg-card-border);
  z-index: 100;
}
.focus-nav-btn {
  flex: 1;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.focus-nav-btn:active { transform: scale(0.95); }
.focus-complete-btn {
  flex: 2;
  padding: 14px;
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.focus-complete-btn:disabled {
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: not-allowed;
}
.focus-complete-btn:not(:disabled):active { transform: scale(0.95); }

/* ═══════════ TASK DETAIL ═══════════ */
.task-detail-content {
  padding: 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.td-title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.td-description { color: var(--text-secondary); font-size: 15px; line-height: 1.5; }
.td-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.td-meta-item { color: var(--text-secondary); font-size: 13px; }
.td-actions {
  display: flex;
  gap: 10px;
}
.td-actions .action-btn { flex: 1; }
.complete-btn {
  background: var(--green) !important;
  color: #fff !important;
}
.complete-btn:disabled {
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
}
.priority-indicator {
  height: 4px;
  border-radius: 2px;
}
.priority-indicator.priority-1 { background: var(--red); }
.priority-indicator.priority-2 { background: var(--blue); }
.priority-indicator.priority-3 { background: var(--gray); }

/* Comments */
.task-comment-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.task-comment-input .notes-input { flex: 1; }
.small-btn {
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.small-btn:active { transform: scale(0.95); }
.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.comment-bubble {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.comment-text { font-size: 14px; color: var(--text-primary); line-height: 1.4; }
.comment-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ═══════════ SCORECARD ═══════════ */
.scorecard-content {
  padding: 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.score-hero {
  text-align: center;
  padding: 32px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
}
.score-hero-pct {
  font-size: 64px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-hero-label {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 4px;
}
.score-hero-streak {
  font-size: 18px;
  font-weight: 700;
  margin-top: 12px;
}
.sc-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sc-stat {
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.sc-stat-num { font-size: 24px; font-weight: 800; }
.sc-stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.sc-weekly {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.sc-day {
  flex: 1;
  text-align: center;
}
.sc-day-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.sc-day-bar-container {
  height: 60px;
  background: var(--bg-card);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.sc-day-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
  min-height: 2px;
}
.sc-day-pct { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.sc-task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-xs);
}
.sc-task-check { font-size: 16px; }
.sc-task-name { flex: 1; font-size: 14px; }
.sc-task-name.done { text-decoration: line-through; color: var(--text-muted); }

/* ═══════════ ADMIN: DAILY DIGEST ═══════════ */
.digest-content {
  padding: 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.digest-date-input {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
}
.digest-users {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.digest-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.digest-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.digest-user-info { flex: 1; }
.digest-user-name { font-size: 14px; font-weight: 600; }
.digest-user-stats { font-size: 12px; color: var(--text-secondary); }
.digest-user-bar {
  flex: 0 0 80px;
  height: 8px;
  background: var(--bg-card-hover);
  border-radius: 4px;
  overflow: hidden;
}
.digest-user-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.digest-user-pct {
  font-size: 14px;
  font-weight: 700;
  width: 45px;
  text-align: right;
}
.digest-overdue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.digest-overdue-item {
  padding: 10px 12px;
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-xs);
  font-size: 13px;
}
.digest-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.digest-photo-item {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.digest-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.digest-photo-item .photo-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  padding: 4px 6px;
  font-size: 10px;
  color: #fff;
}
.empty-hint { color: var(--text-muted); font-size: 14px; text-align: center; padding: 20px; }

/* ═══════════ LEADERBOARD ═══════════ */
.leaderboard-list {
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
}
.lb-row:first-child {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(239, 68, 68, 0.05));
}
.lb-rank {
  font-size: 20px;
  font-weight: 900;
  width: 30px;
  text-align: center;
  color: var(--text-muted);
}
.lb-row:first-child .lb-rank { color: var(--orange); }
.lb-name { flex: 1; font-size: 15px; font-weight: 600; }
.lb-bar-container {
  flex: 0 0 80px;
  height: 8px;
  background: var(--bg-card-hover);
  border-radius: 4px;
  overflow: hidden;
}
.lb-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.6s ease;
}
.lb-pct { font-size: 15px; font-weight: 700; width: 45px; text-align: right; }
.lb-streak { font-size: 12px; color: var(--orange); }

/* ═══════════ ADMIN: USERS ═══════════ */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.user-info { flex: 1; }
.user-name { font-size: 15px; font-weight: 600; }
.user-role { font-size: 12px; color: var(--text-muted); }
.user-actions { display: flex; gap: 6px; }
.user-actions button {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}
.user-inactive { opacity: 0.4; }

/* ═══════════ ADMIN: TASK TYPES ═══════════ */
.types-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.type-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.type-name { flex: 1; font-size: 15px; font-weight: 600; }
.type-delete-btn {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: var(--red-bg);
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
}

/* ═══════════ FORMS ═══════════ */
.form-row {
  margin-bottom: 12px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-input-sm { max-width: 100px; }
.form-select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.form-color {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
}
.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.settings-row {
  padding: 4px 0;
  border-bottom: 1px solid var(--bg-card-border);
}
.tooltip-icon {
  font-size: 14px;
  cursor: pointer;
  opacity: 0.5;
}
.tooltip-popover {
  position: fixed;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 250px;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.priority-picker {
  display: flex;
  gap: 8px;
}
.pri-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.pri-btn.active { border-color: var(--accent); color: var(--text-primary); }

/* ═══════════ CELEBRATION ═══════════ */
.celebration {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.celebration-content {
  text-align: center;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.celebration-emoji { font-size: 80px; margin-bottom: 16px; }
.celebration-content h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}
.celebration-content p { color: var(--text-secondary); font-size: 16px; }

/* ═══════════ EXISTING: PRODUCT LIST ═══════════ */
.progress-bar-container {
  padding: 12px 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 3px;
  transition: width 0.6s ease;
}
.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.search-bar { padding: 0 16px 12px; }
.search-bar input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-muted); }
.product-list {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: calc(16px + var(--safe-bottom));
}
.product-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.product-card:active { transform: scale(0.98); }
.product-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .thumb-placeholder { font-size: 24px; opacity: 0.3; }
.product-info { flex: 1; min-width: 0; }
.product-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}
.product-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-pending { background: var(--orange-bg); color: var(--orange); }
.badge-progress { background: var(--blue-bg); color: var(--blue); }
.badge-complete { background: var(--green-bg); color: var(--green); }
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-secondary); }

/* ═══════════ CAPTURE SCREEN ═══════════ */
.capture-content {
  padding: 16px;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.capture-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.capture-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 16px;
}
.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.optional-tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-card);
}
.count-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.stock-image-container { text-align: center; }
.stock-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.stock-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.no-stock-image {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--bg-card);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.no-photos {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.notes-input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.notes-input:focus { border-color: var(--accent); }
.notes-input::placeholder { color: var(--text-muted); }
.notes-saved {
  text-align: center;
  color: var(--green);
  font-size: 13px;
  padding-top: 8px;
  animation: fadeIn 0.3s;
}
.camera-fab {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border: none;
  border-radius: 50px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  z-index: 50;
  transition: all 0.2s;
}
.camera-fab:active { transform: translateX(-50%) scale(0.95); }
.camera-icon { font-size: 22px; }
.hidden-input { display: none; }
.task-photo-btn {
  width: 100%;
  margin-top: 8px;
}

/* ═══════════ STATUS BADGES ═══════════ */
.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-pending { background: var(--orange-bg); color: var(--orange); }
.status-active { background: var(--blue-bg); color: var(--blue); }
.status-complete { background: var(--green-bg); color: var(--green); }

/* ═══════════ ADMIN SCREEN ═══════════ */
.admin-content {
  padding: 16px;
  padding-bottom: calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.action-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn:active { transform: scale(0.97); }
.danger-card { border-color: rgba(239, 68, 68, 0.2); }
.danger-btn {
  width: 100%;
  padding: 14px;
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.admin-stats { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-card-border);
}
.stat-label { color: var(--text-secondary); font-size: 14px; }
.stat-value { font-weight: 600; font-size: 14px; }
.stat-value.complete { color: var(--green); }
.stat-value.progress { color: var(--blue); }
.stat-value.pending { color: var(--orange); }
.upload-status {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  text-align: center;
}

/* ═══════════ LIGHTBOX ═══════════ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.lightbox img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: calc(16px + var(--safe-top));
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.lightbox-delete {
  padding: 12px 24px;
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
}

/* ═══════════ TOAST ═══════════ */
.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 10000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn 0.3s;
}

/* ═══════════ ADMIN ONLY VISIBILITY ═══════════ */
.admin-only { display: none; }
body.is-admin .admin-only { display: flex; }

/* ═══════════ CLOCK BUTTON ═══════════ */
.clock-btn.clocked-in {
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--green);
}
