/* ==========================================================================
   ChorePay - Mobile-First PWA Styling
   Tailored for iOS Safari & Standalone Home Screen
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #090d16;
  --bg-card: rgba(22, 30, 46, 0.78);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-elevated: #1e293b;
  --bg-input: rgba(15, 23, 42, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-green: #10b981;
  --accent-green-light: #34d399;
  --accent-green-glow: rgba(16, 185, 129, 0.25);

  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  /* Typography & Sizing */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows & Glass */
  --glass-blur: blur(18px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px -2px var(--accent-green-glow);

  /* iOS Safe Areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

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

/* Background Atmosphere */
body::before {
  content: "";
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 350px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* App Container */
.app-container {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--safe-top) + 68px);
  padding-bottom: calc(var(--safe-bottom) + 80px);
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
}

/* Top Sticky Header */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--safe-top) + 64px);
  padding-top: var(--safe-top);
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-green), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-info .app-role-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.brand-info .app-role-badge.worker {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green-light);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sync & Connection Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  transition: all 0.25s ease;
  cursor: pointer;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  transition: all 0.25s ease;
}

.status-pill.offline .status-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.status-pill.syncing .status-dot {
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
  animation: pulse-dot 1.2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Role Switcher Pill */
.role-btn {
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--safe-bottom) + 64px);
  padding-bottom: var(--safe-bottom);
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 90;
  max-width: 540px;
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.nav-item * {
  pointer-events: none;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.nav-item.active {
  color: var(--accent-green);
}

.nav-item.active svg {
  stroke: var(--accent-green);
  transform: translateY(-2px);
}

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

.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
}

/* View Section Handling */
.view-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view-section.active {
  display: block;
}

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

/* Hero Balance Card */
.balance-hero {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(30, 41, 59, 0.6) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.balance-hero::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.hero-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-green-light);
}

.balance-amount {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.balance-substats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-box {
  display: flex;
  flex-direction: column;
}

.stat-box .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-box .stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.stat-box.pending .stat-value {
  color: var(--accent-amber);
}

/* Offline Queue Banner */
.offline-banner {
  display: none;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
  animation: fadeIn 0.3s ease;
}

.offline-banner.visible {
  display: flex;
}

.offline-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fde68a;
}

.offline-text svg {
  width: 20px;
  height: 20px;
  stroke: #f59e0b;
}

.sync-now-btn {
  background: var(--accent-amber);
  color: #78350f;
  border: none;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.sync-now-btn:active {
  transform: scale(0.95);
}

/* Section Header */
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Chores Card Grid */
.chores-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chore-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.chore-card:active {
  transform: scale(0.98);
  background-color: var(--bg-card-hover);
  border-color: rgba(16, 185, 129, 0.3);
}

.chore-info {
  flex: 1;
  min-width: 0;
}

.chore-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
}

.chore-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chore-action-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.payout-tag {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-green-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.log-btn-small {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-green);
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: #131b2e;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: calc(var(--safe-bottom) + 24px);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-sheet-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  margin: 0 auto 16px auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.modal-close-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* Upload & Capture Component */
.media-upload-container {
  margin: 16px 0;
}

.upload-picker-box {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.upload-picker-box:active {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.05);
}

.upload-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--accent-green);
}

.upload-text-main {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-text-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-input-hidden {
  display: none;
}

/* Media Preview Card */
.preview-card {
  display: none;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  max-height: 260px;
}

.preview-card.visible {
  display: block;
}

.preview-card img, .preview-card video {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}

.remove-media-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.compression-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(16, 185, 129, 0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

/* Alert Warnings */
.warning-box {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fecdd3;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-top: 10px;
  display: none;
}

.warning-box.visible {
  display: block;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 12px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px var(--accent-green-glow);
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
  min-height: 48px;
}

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

.btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  min-height: 44px;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-rose), #be123c);
  color: #ffffff;
}

/* Parent Review Queue Items */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.review-chore-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.review-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.review-media-wrapper {
  margin: 10px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  max-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-media-wrapper img, .review-media-wrapper video {
  max-height: 240px;
  width: 100%;
  object-fit: contain;
}

.review-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border-left: 3px solid var(--accent-indigo);
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-approve {
  background: var(--accent-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-reject {
  background: rgba(244, 63, 94, 0.18);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

/* History & Activity Logs */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.status-badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.rejected {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* PIN Keypad Modal */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: transparent;
  transition: all 0.15s ease;
}

.pin-dot.filled {
  background: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
}

.keypad-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  height: 58px;
  border-radius: var(--radius-md);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.12s ease;
}

.keypad-btn:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.94);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 72px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.success {
  border-left: 4px solid var(--accent-green);
}

.toast.warning {
  border-left: 4px solid var(--accent-amber);
}

.toast.error {
  border-left: 4px solid var(--accent-rose);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-dim);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-dim);
  margin-bottom: 12px;
}

/* ==========================================================================
   Multi-Child Switcher & Profile Pills
   ========================================================================== */
.child-selector-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.child-pill {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
  user-select: none;
}

.child-pill:active {
  transform: scale(0.97);
}

.child-pill-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.child-avatar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.child-pill-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.child-pill-balance {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-green-light);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.child-pill.active {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.child-pill.active.child-christopher {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.25);
}

.child-pill.child-christopher .child-avatar-dot {
  background: var(--accent-blue);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.child-pill.child-christopher .child-pill-balance {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
}

/* Active Single-Worker Session Card */
.active-worker-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 60px;
}

.active-worker-card.alexander {
  border-left: 4px solid var(--accent-green);
}

.active-worker-card.christopher {
  border-left: 4px solid var(--accent-blue);
}

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

.active-worker-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.active-worker-avatar.empty {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.active-worker-subtitle {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-dim);
}

.active-worker-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-worker-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-worker-balance {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-green-light);
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.active-worker-balance.christopher {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
}

.btn-switch-worker {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.btn-switch-worker:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.16);
}

/* Child Login Selection Modal Grid */
.child-login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 16px;
}

.child-login-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.child-login-card:active {
  transform: scale(0.96);
}

.child-login-card.alexander {
  border-color: rgba(16, 185, 129, 0.4);
}

.child-login-card.alexander:hover,
.child-login-card.alexander.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.child-login-card.christopher {
  border-color: rgba(59, 130, 246, 0.4);
}

.child-login-card.christopher:hover,
.child-login-card.christopher.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.08);
}

.child-login-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.child-login-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.child-login-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.child-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  transition: all 0.2s ease;
}

.child-pin-dot.filled {
  background: var(--accent-blue);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Child Badges in Lists & Modals */
.child-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: #10b981;
}

.child-badge.alexander {
  background: #10b981;
}

.child-badge.christopher {
  background: #3b82f6;
}

/* Settlement Cards in Parent Mode */
.settlement-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.child-settle-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.child-settle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Email Reminder Cards */
.email-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.email-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

/* ==========================================================================
   Savings Goals & Wishlist Progress Bars
   ========================================================================== */
.wishlist-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.wishlist-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

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

.wishlist-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wishlist-icon {
  font-size: 1.6rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wishlist-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.wishlist-child-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.wishlist-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.wishlist-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.wishlist-amounts {
  font-weight: 700;
  color: var(--accent-green-light);
}

.wishlist-percentage {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
}

.wishlist-bar-track {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wishlist-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.wishlist-bar-fill.ready {
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); box-shadow: 0 0 10px rgba(16, 185, 129, 0.6); }
}

.wishlist-ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid var(--accent-green);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-top: 8px;
}

/* ==========================================================================
   Chore Cadence & Brother Rotation Badges
   ========================================================================== */
.chore-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.cadence-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}

.cadence-tag.daily {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.cadence-tag.weekly {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.cadence-tag.on_demand {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.turn-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Subtasks Accordion in Card */
.subtasks-preview {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.subtask-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* ==========================================================================
   Appliance QR Codes & Scanner Modal
   ========================================================================== */
.btn-qr-scan {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-qr-scan:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.15);
}

.scanner-viewport {
  width: 100%;
  height: 260px;
  background: #000;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-reticle {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 2px dashed rgba(16, 185, 129, 0.8);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* ==========================================================================
   Printable Appliance QR Code Sheets
   ========================================================================== */
.printable-sheet-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.appliance-sticker {
  background: #ffffff;
  color: #0f172a;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  page-break-inside: avoid;
}

.appliance-sticker-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: #0f172a;
}

.appliance-sticker-payout {
  font-size: 0.85rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 10px;
}

.appliance-sticker-qr {
  margin: 6px 0;
}

.appliance-sticker-hint {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 6px;
  font-weight: 600;
}

@media print {
  body * {
    visibility: hidden;
  }
  #printable-qr-modal, #printable-qr-modal * {
    visibility: visible;
  }
  #printable-qr-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #ffffff !important;
    color: #000000 !important;
  }
  .modal-overlay {
    background: transparent !important;
  }
  .modal-sheet {
    background: transparent !important;
    border: none !important;
    max-width: 100% !important;
  }
  .modal-header, .no-print {
    display: none !important;
  }
  .printable-sheet-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
  .appliance-sticker {
    border: 2px dashed #333333 !important;
    break-inside: avoid !important;
  }
}

