/* ============================================
   SVM Task Tracker — Design System & Styles
   Dark Glassmorphism · Mobile-First · Premium
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Colors */
  --bg-primary: #0a0a1a;
  --bg-secondary: #0f0f23;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-active: rgba(255, 255, 255, 0.15);

  --accent-purple: #7c3aed;
  --accent-purple-glow: rgba(124, 58, 237, 0.3);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.25);
  --accent-blue: #3b82f6;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Gradients */
  --gradient-purple: linear-gradient(135deg, #7c3aed, #a78bfa);
  --gradient-emerald: linear-gradient(135deg, #10b981, #34d399);
  --gradient-amber: linear-gradient(135deg, #f59e0b, #fbbf24);
  --gradient-hero: linear-gradient(135deg, #0f0f23 0%, #1a0a2e 50%, #0f0f23 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-purple: 0 0 20px var(--accent-purple-glow);
  --shadow-glow-emerald: 0 0 20px var(--accent-emerald-glow);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-heavy: rgba(255, 255, 255, 0.9);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glass-active: rgba(0, 0, 0, 0.15);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- App Container ---------- */
#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-md);
  padding-top: calc(115px + var(--space-md) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--space-2xl) + env(safe-area-inset-bottom, 20px));
}

/* ---------- Loading Screen ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-lg);
  animation: pulse-scale 1.5s ease-in-out infinite;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---------- Auth Overlay ---------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: var(--space-lg);
  animation: fadeIn 0.3s ease;
}

.auth-card {
  background: var(--gradient-card);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: slideUp 0.4s var(--transition-spring);
}

.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: left;
}

.auth-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.auth-form input,
.auth-form select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-fast);
}

.light-theme .auth-form input,
.light-theme .auth-form select {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.auth-error {
  color: var(--accent-red);
  font-size: 0.85rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.auth-submit-btn {
  margin-top: var(--space-sm);
  width: 100%;
  padding: var(--space-md);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.auth-footer {
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-purple);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Auth modal buttons (reusing generic button styles later, but btn-sm helper here) */
.btn-sm {
  padding: var(--space-xs) var(--space-md) !important;
  font-size: 0.8rem !important;
  margin-top: 0 !important;
  width: auto !important;
}

/* ---------- Header ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 10px) + 10px) var(--space-md) 10px var(--space-md);
  height: auto;
  min-height: 100px; /* Increased to accommodate two rows comfortably */
  background: rgba(10, 10, 20, 0.95);
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-sizing: border-box;
  gap: var(--space-xs);
}

/* Force line break for the navigation pill */
.app-header::after {
  content: "";
  flex-basis: 100%;
  order: 2;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-center {
  order: 3;
  width: fit-content;
  margin-inline: auto;
  display: flex;
  justify-content: center;
  margin-top: var(--space-xs);
  z-index: 5;
}

/* Ensure greeting doesn't overlap or wrap weirdly */
.header-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* Fix: ensures left alignment */
}

.greeting {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (min-width: 500px) {
  .app-header {
    padding-top: env(safe-area-inset-top, 10px);
  }
  .greeting {
    max-width: none;
  }
}

.light-theme .app-header {
  background: rgba(248, 250, 252, 0.92);
}

.header-left h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.2;
}

.header-left h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-left .greeting {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 1rem;
}

.light-theme .header-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1e293b;
}

.header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-glass-active);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 0 var(--space-sm);
  height: 32px;
  color: var(--accent-red);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

.logout-btn span {
  display: none;
}

@media (min-width: 600px) {
  .logout-btn span {
    display: inline;
  }
}

/* Theme Icons Toggle */
.theme-sun { display: block; }
.theme-moon { display: none; }

.light-theme .theme-sun { display: none; }
.light-theme .theme-moon { display: block; }

.user-avatar {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow-purple);
}

/* Navigation Tabs */
.header-center {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.nav-tab {
  background: none;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.nav-tab.active {
  background: var(--accent-purple);
  color: white;
  box-shadow: var(--shadow-glow-purple);
}

.nav-tab:hover:not(.active) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ---------- AI Briefing Card ---------- */
.briefing-card {
  background: var(--gradient-card);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.5s ease;
}

.briefing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-purple);
}

.briefing-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.briefing-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-purple-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.briefing-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-purple);
}

.briefing-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.briefing-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.briefing-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s infinite;
}

.skeleton-line:nth-child(2) { width: 85%; }
.skeleton-line:nth-child(3) { width: 60%; }

/* ---------- Section ---------- */
.task-section {
  margin-bottom: var(--space-lg);
  animation: slideUp 0.5s ease;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding: 0 var(--space-xs);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.section-title .icon {
  font-size: 1rem;
}

.section-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

/* ---------- Task Card ---------- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-active);
  transform: translateX(4px);
}

.task-card:active {
  transform: scale(0.98);
}

.task-card.overdue {
  border-left: 3px solid var(--accent-red);
}

.task-card.overdue::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-red);
  animation: pulse-opacity 2s ease-in-out infinite;
}

.task-card.completing {
  animation: taskComplete 0.6s ease forwards;
}

.task-card.done {
  opacity: 0.5;
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.15);
}

.task-card.done .task-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Checkbox */
.task-checkbox {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-base);
  position: relative;
}

.task-card:hover .task-checkbox {
  border-color: var(--accent-emerald);
}

.task-card.done .task-checkbox {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  box-shadow: var(--shadow-glow-emerald);
}

.task-checkbox .check-icon {
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-spring);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

.task-card.done .task-checkbox .check-icon {
  opacity: 1;
  transform: scale(1);
}

/* Task info */
.task-info {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-base);
  line-height: 1.4;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.task-badge {
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-daily {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-purple);
}

.badge-weekly {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.badge-one-time {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.badge-overdue {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  animation: pulse-opacity 2s ease-in-out infinite;
}

.badge-in-progress {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.badge-stuck {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.task-nudge-btn:hover {
  background: var(--bg-card);
  color: var(--accent-purple);
}

.workflow-health-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.health-item:last-child {
  border-bottom: none;
}

.health-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.health-value {
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

.health-value.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.health-value.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.health-value.good {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

/* ---------- Stats Card ---------- */
.stats-card {
  background: var(--gradient-card);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  animation: slideUp 0.6s ease;
}

.stats-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-value.purple { color: var(--accent-purple); }
.stat-value.emerald { color: var(--accent-emerald); }
.stat-value.amber { color: var(--accent-amber); }

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ---------- Progress Bar ---------- */
.progress-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-glass);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: var(--space-sm);
}

.progress-label span:first-child { color: var(--text-secondary); }
.progress-label span:last-child { color: var(--accent-emerald); font-weight: 600; }

.progress-bar {
  height: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-emerald);
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: var(--radius-full);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-dim);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.empty-state p {
  font-size: 0.85rem;
}

/* ---------- All Done Celebration ---------- */
.all-done {
  text-align: center;
  padding: var(--space-xl);
  animation: slideUp 0.5s var(--transition-spring);
}

.all-done .trophy {
  font-size: 3.5rem;
  animation: bounce 1s ease infinite;
  margin-bottom: var(--space-md);
}

.all-done h3 {
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient-emerald);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
}

.all-done p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ---------- Confetti Canvas ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 800;
  transition: transform var(--transition-spring);
  white-space: nowrap;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-red); }

/* ---------- Error Banner ---------- */
.error-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--accent-red);
  animation: slideUp 0.3s ease;
}

.error-banner .retry-btn {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.15);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  color: var(--accent-red);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.error-banner .retry-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ---------- Floating Action Button ---------- */
.fab {
  position: fixed;
  bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 20px));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-purple);
  border: none;
  color: white;
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: var(--shadow-lg), var(--shadow-glow-purple);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg), 0 0 30px var(--accent-purple-glow);
}

.fab:active {
  transform: scale(0.95);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 950;
  padding: var(--space-md);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-lg) var(--radius-lg);
  padding: var(--space-lg);
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.3s var(--transition-spring);
}

.modal-card-sm {
  max-width: 400px;
}

.modal-card-lg {
  max-width: 800px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.dashboard-content {
  overflow-y: auto;
  padding: var(--space-md) 0;
}

/* ---------- KPI Summary Cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.4s ease backwards;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }

.kpi-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.kpi-value.purple { color: var(--accent-purple); }
.kpi-value.emerald { color: var(--accent-emerald); }
.kpi-value.amber { color: var(--accent-amber); }

.kpi-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------- Leaderboard Top 3 ---------- */
.leaderboard-top3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* Base Dashboard Card Enhancements */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.dashboard-card {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  animation: slideUp 0.5s ease backwards;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Top 3 Special Styles */
.dashboard-card.rank-1-card {
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}
.dashboard-card.rank-2-card {
  border: 1px solid rgba(192, 192, 192, 0.4);
}
.dashboard-card.rank-3-card {
  border: 1px solid rgba(205, 127, 50, 0.4);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.dashboard-card-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  flex: 1;
}

.dashboard-card-score {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent-purple);
  text-align: right;
}

.dashboard-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass-heavy);
  border: 1px solid var(--border-glass);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.dashboard-rank.rank-1 { background: rgba(255, 215, 0, 0.2); border-color: #ffd700; color: #ffd700; text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
.dashboard-rank.rank-2 { background: rgba(192, 192, 192, 0.2); border-color: #c0c0c0; color: #c0c0c0; }
.dashboard-rank.rank-3 { background: rgba(205, 127, 50, 0.2); border-color: #cd7f32; color: #cd7f32; }

/* Circular Progress Charts */
.circular-chart-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-sm) 0 var(--space-md) 0;
  padding: var(--space-sm);
  background: rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
}

.circular-chart {
  width: 60px;
  height: 60px;
}
.circular-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 3.8;
}
.circular-fill {
  fill: none;
  stroke: var(--accent-emerald);
  stroke-width: 2.8;
  stroke-linecap: round;
  transition: stroke-dasharray 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.circular-text {
  fill: var(--text-primary);
  font-size: 8px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.chart-stats-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-left: var(--space-md);
  gap: 4px;
}

.dashboard-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dashboard-stats-row:last-child {
  border-bottom: none;
}

.dashboard-stat-val {
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-stat-val.missed { color: var(--accent-red); }
.dashboard-stat-val.late { color: var(--accent-amber); }
.dashboard-stat-val.completed { color: var(--accent-emerald); }

.btn-export {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  color: var(--accent-emerald);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-right: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-export:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.light-theme .btn-export {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
}

/* ---------- Controls Section ---------- */
.controls-section {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  animation: slideDown 0.4s ease-out;
}

.search-box {
  flex: 1;
}

.search-box input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-base);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: var(--bg-card);
}

.filter-box select {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-box select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.light-theme .filter-box select {
  background: #ffffff;
}

.light-theme .filter-box select option {
  background-color: #ffffff;
  color: #1e293b;
}

/* ---------- Priority Badges ---------- */
.priority-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.priority-high { background: var(--accent-red-glow); color: var(--accent-red); }
.priority-medium { background: var(--accent-amber-glow); color: var(--accent-amber); }
.priority-low { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }

/* ---------- Theme Toggle Icon ---------- */
.theme-sun { display: block; }
.light-theme .theme-sun { display: none; }
.theme-moon { display: none; }
.light-theme .theme-moon { display: block; }

/* ---------- Task Card Action Buttons ---------- */
.task-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: auto;
  align-items: center;
}

.task-edit-btn, .task-shift-btn, .task-comment-btn {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-edit-btn:hover {
  background: var(--bg-card);
  color: var(--accent-purple);
}

.task-shift-btn:hover {
  background: var(--bg-card);
  color: var(--accent-amber);
}

.task-comment-btn:hover {
  background: var(--bg-card);
  color: var(--accent-emerald);
}

/* ---------- Broadcast Banner ---------- */
.broadcast-banner {
  margin: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--gradient-purple);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-glow-purple);
  animation: slideUp 0.5s ease-out;
  position: relative;
  z-index: 100;
}

.broadcast-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
}

.broadcast-icon {
  font-size: 1.2rem;
}

.broadcast-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: background 0.2s;
}

.broadcast-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.comment-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.modal-body-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: var(--space-md);
}

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

.form-group input,
.form-group select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.form-group select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.btn-primary {
  width: 100%;
  padding: var(--space-sm) var(--space-lg);
  background: var(--gradient-purple);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-top: var(--space-sm);
}

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

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  flex: 1;
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-danger {
  flex: 1;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  filter: brightness(1.1);
}
/* ---------- Task Delete Button ---------- */
.task-delete-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--accent-red);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  opacity: 1;
  -webkit-tap-highlight-color: transparent;
}

.task-card:hover .task-delete-btn {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Always show on touch devices */
@media (hover: none) {
  .task-delete-btn {
    opacity: 0.6;
  }
}

.task-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  padding: var(--space-lg) 0;
  padding-bottom: calc(var(--space-lg) + 70px);
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes pulse-scale {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.badge-count {
  background: var(--accent-red);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes taskComplete {
  0% { transform: scale(1); }
  30% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 0.5; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-15px); }
  60% { transform: translateY(-7px); }
}

@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Stagger animation delays for task cards */
.task-card:nth-child(1) { animation-delay: 0ms; }
.task-card:nth-child(2) { animation-delay: 50ms; }
.task-card:nth-child(3) { animation-delay: 100ms; }
.task-card:nth-child(4) { animation-delay: 150ms; }
.task-card:nth-child(5) { animation-delay: 200ms; }
.task-card:nth-child(6) { animation-delay: 250ms; }

.task-card {
  animation: slideUp 0.4s ease backwards;
}

.member-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ---------- Responsive ---------- */
@media (min-width: 480px) {
  #app {
    padding: var(--space-xl);
  }

  .user-picker-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  #app {
    max-width: 560px;
  }
  .app-header {
    max-width: 560px;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  :root {
    --space-lg: 16px;
    --space-xl: 24px;
  }

  html {
    font-size: 14px;
  }

  .header-left h1 {
    font-size: 1rem;
  }

  .user-picker-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: var(--radius-full);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-purple);
  color: white;
}

/* ---------- Safe area for notched phones ---------- */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
  }
}
/* Voice Input */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  padding-right: 40px !important;
}

.voice-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 50%;
}

.voice-btn:hover {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
}

.voice-btn.listening {
  color: #ef4444;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ---------- Test Tracker ---------- */
#test-tracker-container {
  animation: fadeIn 0.4s ease;
}

.test-card {
  background: var(--gradient-card);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: all var(--transition-base);
}

.test-card:hover {
  border-color: var(--border-glass-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.test-card.overdue {
  border-left: 4px solid var(--accent-red);
}

.test-card.overdue::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-red);
  animation: pulse-opacity 2s ease-in-out infinite;
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.test-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.test-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.test-meta-info {
  display: flex;
  gap: var(--space-md);
  margin-top: 4px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-item .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
}

.meta-item .val {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.test-pipeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: var(--space-md);
  padding-bottom: var(--space-sm);
  overflow-x: auto;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* Connecting Line */
.test-pipeline::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--border-glass);
  z-index: 0;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  min-width: 80px;
  position: relative;
  z-index: 1;
}

.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-base);
}

.pipeline-step.done .step-indicator {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: white;
  box-shadow: var(--shadow-glow-emerald);
}

.pipeline-step.current .step-indicator {
  background: var(--bg-secondary);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: var(--shadow-glow-purple);
}

.pipeline-step.delayed .step-indicator {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
  box-shadow: 0 0 12px var(--accent-red-glow);
  animation: pulse-opacity 2s ease-in-out infinite;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-step.done .step-label { color: var(--accent-emerald); }
.pipeline-step.current .step-label { color: var(--text-primary); }
.pipeline-step.delayed .step-label { color: var(--accent-red); }

.step-date {
  font-size: 0.6rem;
  color: var(--text-dim);
}

/* Mobile adjustments for pipeline */
@media (max-width: 480px) {
  .test-pipeline {
    justify-content: flex-start;
  }
}

/* Button Enhancements */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-active);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-ghost.btn-sm {
  padding: 4px 10px;
  font-size: 0.7rem;
}

.btn-primary.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.btn-secondary.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary.btn-sm:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-active);
} 
