@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f9fafb;
  --accent-primary: #0064a5;
  --accent-secondary: #87b41e;
  --text-primary: #1a171b;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border-color: rgba(26, 23, 27, 0.12);
  --error: #ef4444;
  --success: #87b41e;
  --accent-green: #467350;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Auth Pages Container */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding: 2rem 1.5rem;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 100, 165, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo .icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.auth-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--text-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
}

.form-control {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 100, 165, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #005084 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(0, 100, 165, 0.2);
  margin-top: 0.5rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 100, 165, 0.3);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

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

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
  display: none;
  animation: fadeIn 0.3s ease;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #991b1b;
  display: block;
}

.alert-success {
  background-color: rgba(135, 180, 30, 0.1);
  border-color: rgba(135, 180, 30, 0.2);
  color: #3f6212;
  display: block;
}

/* App / Main Layout */
.app-layout {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  background: rgba(0, 100, 165, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 80, 132, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-group span {
  font-size: 1.5rem;
}

.logo-group h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  -webkit-text-fill-color: white;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-email {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  display: none;
}

@media(min-width: 600px) {
  .user-email {
    display: inline;
  }
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.logout-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Content Area */
.main-content {
  flex-grow: 1;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 1rem 6rem 1rem; /* bottom padding for mobile sticky toolbar/footer */
}

/* Progress bar container */
.progress-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 100, 165, 0.08);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.progress-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-pct {
  font-weight: 700;
  color: var(--accent-primary);
}

.progress-track {
  background: var(--bg-tertiary);
  border-radius: 10px;
  height: 8px;
  width: 100%;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  height: 100%;
  width: 0%;
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Category Filter Tabs */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  border-radius: 100px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.tab-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 10px rgba(0, 100, 165, 0.25);
}

/* Checklist Sections */
.category-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: var(--transition-smooth);
}

.category-card-header {
  padding: 1.25rem 1.5rem;
  background: rgba(0, 100, 165, 0.04);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.category-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.delete-category-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  opacity: 0;
  transition: var(--transition-smooth);
}

.category-card:hover .delete-category-btn {
  opacity: 1;
}

.delete-category-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.checklist-list {
  list-style: none;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

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

.checklist-item:hover {
  background: rgba(0, 100, 165, 0.04);
}

.checklist-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  flex-grow: 1;
  user-select: none;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  position: relative;
}

.custom-checkbox::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-smooth);
}

.checklist-input {
  display: none;
}

.checklist-input:checked + .custom-checkbox {
  background-color: var(--accent-secondary);
  border-color: var(--accent-secondary);
  box-shadow: 0 0 8px rgba(135, 180, 30, 0.3);
}

.checklist-input:checked + .custom-checkbox::after {
  opacity: 1;
  transform: scale(1);
}

.item-name {
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.checklist-input:checked ~ .item-name {
  color: var(--text-muted);
  text-decoration: line-through;
}

.delete-item-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  opacity: 0;
  transition: var(--transition-smooth);
}

.checklist-item:hover .delete-item-btn {
  opacity: 1;
}

.delete-item-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Floating Actions & Sticky toolbar */
.fab-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 90;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #005084 100%);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 100, 165, 0.4);
  transition: var(--transition-smooth);
}

.fab:hover {
  transform: scale(1.05);
}

.fab-reset {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fab-reset:hover {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.logo-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.logo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.header .logo-img {
  width: auto;
  height: 48px; /* Taller */
  margin-bottom: 0;
}

.logo-group h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.1rem;
}

.logout-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.6rem;
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.logout-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.logout-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

/* Hero / Title Card */
.checklist-hero-card {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #005084 60%, var(--accent-green) 100%);
  border-radius: 20px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 24px rgba(0, 100, 165, 0.25);
  position: relative;
  overflow: hidden;
}

.checklist-hero-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.checklist-hero-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.checklist-hero-text {
  flex-grow: 1;
}

.checklist-hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0;
}

.checklist-hero-subtitle {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.2rem;
}

.checklist-hero-badge {
  flex-shrink: 0;
}

.checklist-hero-badge span {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.3px;
}

/* Activity Selector Card */
.activity-selector-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.selector-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  flex-grow: 1;
}

.selector-wrapper label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.selector-dropdown {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.selector-dropdown:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.selector-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 10px;
  margin-top: 0;
  white-space: nowrap;
  width: auto;
}

.btn-small.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: none;
}

.btn-small.btn-secondary:hover {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .auth-container {
    padding: 1rem 1rem;
  }
  
  .auth-card {
    padding: 1.5rem 1.25rem;
  }
  
  .header {
    padding: 0.75rem 1rem;
  }

  .header-container {
    gap: 0.5rem;
  }

  .logo-group h2 {
    display: none; /* Hide 'Checklist' text next to logo on very narrow screens to save space */
  }

  .user-menu {
    gap: 0.5rem;
  }

  .admin-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  .main-content {
    padding: 1rem 0.75rem 6rem 0.75rem;
  }

  .activity-selector-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }

  .selector-actions {
    justify-content: flex-end;
  }

  .checklist-item {
    padding: 0.85rem 0.75rem;
  }
  
  .delete-item-btn {
    opacity: 1; /* Always show delete button on mobile since hover doesn't exist */
  }

  .delete-category-btn {
    opacity: 1;
  }

  .checklist-hero-card {
    padding: 1rem;
  }

  .checklist-hero-icon {
    font-size: 1.8rem;
  }

  .checklist-hero-title {
    font-size: 1.2rem;
  }
}


/* =============================================
   Admin Panel Styles
   ============================================= */

.admin-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.admin-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.admin-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-badge {
  background: var(--accent-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  flex-wrap: wrap;
}

.admin-item-info {
  flex-grow: 1;
  min-width: 0;
}

.admin-item-email {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.role-badge--admin {
  background: rgba(0, 100, 165, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(0, 100, 165, 0.3);
}

.role-badge--user {
  background: rgba(135, 180, 30, 0.12);
  color: #467350;
  border: 1px solid rgba(135, 180, 30, 0.3);
}

.global-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  background: rgba(0, 100, 165, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(0, 100, 165, 0.3);
}

.admin-icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.admin-icon-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.admin-icon-btn--danger:hover {
  border-color: var(--error);
  color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

/* Toggle switch for is_global */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  border-radius: 100px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

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

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

/* Assign modal user checkboxes */
.assign-user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
}

.assign-user-row:last-child {
  border-bottom: none;
}

.assign-user-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.assign-user-row label {
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* =============================================
   Stats Dashboard
   ============================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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

.stat-card {
  border-radius: 16px;
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -15px;
  right: -15px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.stat-card--blue {
  background: linear-gradient(135deg, #0064a5 0%, #004e82 100%);
  box-shadow: 0 4px 16px rgba(0, 100, 165, 0.3);
}

.stat-card--green {
  background: linear-gradient(135deg, #467350 0%, #34593e 100%);
  box-shadow: 0 4px 16px rgba(70, 115, 80, 0.3);
}

.stat-card--lime {
  background: linear-gradient(135deg, #87b41e 0%, #6b9018 100%);
  box-shadow: 0 4px 16px rgba(135, 180, 30, 0.3);
}

.stat-card--teal {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  box-shadow: 0 4px 16px rgba(8, 145, 178, 0.3);
}

.stat-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Secondary pills row */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  flex-shrink: 0;
}

.stat-pill-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.stat-pill-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Top user rows inside admin-list */
.stat-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  flex-wrap: wrap;
}

.stat-user-email {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.stat-mini-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 100px;
  background: rgba(0, 100, 165, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(0, 100, 165, 0.2);
}

.stat-mini-badge--green {
  background: rgba(135, 180, 30, 0.1);
  color: #467350;
  border-color: rgba(135, 180, 30, 0.25);
}

/* Completion mini bar */
.stat-completion-bar {
  width: 64px;
  height: 6px;
  background: var(--border-color);
  border-radius: 100px;
  overflow: hidden;
}

.stat-completion-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-green));
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
