* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #e8eaed;
  --bg-card: #ffffff;
  --bg-subtle: #f1f3f4;
  --text-primary: #1a1a2e;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --accent: #4f46e5;
  --accent-light: #e0e7ff;
  --accent-hover: #4338ca;
  --success: #0d9488;
  --success-light: #ccfbf1;
  --warning: #b45309;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --border: #dadce0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 24px;
  line-height: 1.5;
}

#app {
  max-width: 860px;
  margin: 0 auto;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Auth Section */
.auth-section {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-section input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg-card);
}

.auth-section input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-section button {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-section button:hover {
  background: var(--accent-hover);
}

.auth-status {
  background: var(--success-light);
  color: var(--success);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

/* New Deal Form */
.new-deal-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.new-deal-form h2 {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg-card);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg-card);
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group label .optional {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.85rem;
}

/* Deal Type Toggle */
.deal-type-toggle {
  display: flex;
  gap: 8px;
}

.deal-type-toggle button {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.deal-type-toggle button:hover {
  background: var(--border);
}

.deal-type-toggle button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-create {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-create:hover {
  background: var(--accent-hover);
}

/* Deals Section */
.deals-section {
  margin-bottom: 40px;
}

/* Kid Filter */
.kid-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.kid-filter button {
  padding: 8px 16px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.kid-filter button:hover {
  background: var(--border);
  color: var(--text-primary);
}

.kid-filter button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Assignee Badge */
.deal-assignee {
  margin-bottom: 12px;
}

.assignee-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Deal Description */
.deal-description {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Deal Progress */
.deal-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.deal-progress .progress-stats {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.deal-action-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.deal-progress .count-display {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.deal-progress .count-display span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 50px;
}

.deal-progress .count-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Deal Card */
.deal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.15s;
}

.deal-card:hover {
  box-shadow: var(--shadow-md);
}

.deal-card.urgent {
  border-color: var(--danger);
  border-width: 2px;
}

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

.deal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.reward-badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
}

.reward-badge.earned {
  background: var(--success-light);
  color: var(--success);
}

/* Days Remaining */
.deal-deadline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.days-remaining {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.days-remaining.safe {
  background: var(--success-light);
  color: var(--success);
}

.days-remaining.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.days-remaining.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.days-number {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.days-label {
  font-size: 0.8rem;
  font-weight: 500;
}

.deadline-date {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Daily Progress Counter */
.daily-progress {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.days-done {
  font-weight: 600;
  color: var(--text-primary);
}

.total-days {
  color: var(--text-secondary);
}

/* Count Progress */
.count-progress {
  text-align: center;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.count-display {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.count-current {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.count-separator {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.count-target {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.count-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.count-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.count-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Deal Actions */
.deal-actions {
  display: flex;
  gap: 8px;
}

.btn-did-it {
  flex: 1;
  padding: 10px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-did-it:hover {
  opacity: 0.9;
}

.btn-didnt-do-it {
  flex: 1;
  padding: 10px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-didnt-do-it:hover:not(:disabled) {
  background: var(--border);
}

.btn-didnt-do-it:disabled,
.btn-did-it:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-mark-complete {
  flex: 1;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-mark-complete:hover {
  opacity: 0.9;
}

.btn-delete {
  padding: 10px 14px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

/* Quick Missed Days Section */
.quick-missed-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-calendar {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

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

/* Calendar Modal */
.calendar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.calendar-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.calendar-header {
  position: relative;
  text-align: center;
  margin-bottom: 20px;
}

.calendar-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.calendar-deal-title {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  background: var(--bg-subtle);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn-nav {
  width: 32px;
  height: 32px;
  background: var(--bg-subtle);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-nav:hover {
  background: var(--border);
  color: var(--text-primary);
}

.month-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--success-light);
  color: var(--success);
  font-weight: 500;
}

.calendar-day:hover:not(.empty):not(.disabled) {
  opacity: 0.8;
}

.calendar-day.empty {
  background: transparent;
  cursor: default;
}

.calendar-day.disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}

.calendar-day.missed {
  background: var(--danger-light);
  color: var(--danger);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-done,
.legend-missed {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-done {
  background: var(--success-light);
}

.legend-missed {
  background: var(--danger-light);
}

.calendar-footer {
  margin-top: 20px;
  text-align: center;
}

.btn-done {
  padding: 10px 28px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-done:hover {
  background: var(--accent-hover);
}

/* Rewards Section */
.rewards-section h2 {
  color: var(--text-primary);
}

.reward-card {
  background: var(--bg-card);
  border-left: 3px solid var(--success);
}

.reward-stats {
  display: flex;
  justify-content: space-around;
  padding: 16px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.success-rate .stat-value {
  color: var(--success);
}

.celebration {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px;
}

/* Message Toast */
.message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  animation: toastIn 0.2s ease;
  z-index: 1000;
}

.message.success {
  background: var(--text-primary);
  color: white;
}

.message.error {
  background: var(--danger);
  color: white;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 16px;
  }

  header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    text-align: center;
  }

  h1 {
    font-size: 1.3rem;
  }

  .auth-section {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .auth-section input,
  .auth-section button {
    width: 100%;
  }

  .new-deal-form {
    padding: 20px;
  }

  .form-group input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .deals-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .deal-card {
    padding: 16px;
  }

  .deal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .reward-badge {
    align-self: flex-start;
  }

  .deal-deadline {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .days-remaining {
    justify-content: center;
  }

  .deadline-date {
    text-align: center;
  }

  .deal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .deal-actions button {
    width: 100%;
    padding: 14px;
    min-height: 48px;
  }

  .daily-progress {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .reward-stats {
    flex-wrap: wrap;
    gap: 16px;
  }

  .stat {
    flex: 1;
    min-width: 70px;
  }

  .calendar-modal {
    padding: 20px;
    margin: 10px;
  }

  .calendar-day {
    font-size: 0.8rem;
  }

  .message {
    left: 16px;
    right: 16px;
    transform: none;
    text-align: center;
  }
}

/* Touch-friendly sizing */
@media (pointer: coarse) {
  .deal-actions button,
  .auth-section button,
  .btn-create,
  .btn-calendar,
  .btn-done {
    min-height: 48px;
  }

  .calendar-day {
    min-height: 36px;
  }
}

/* Entry Screen */
.entry-screen {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
  padding: 40px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.entry-screen h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.screen-subtitle {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.entry-form input {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  text-align: center;
}

.entry-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.btn-primary {
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  padding: 12px 20px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

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

.admin-link, .back-link {
  margin-top: 24px;
}

.admin-link a, .back-link a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.admin-link a:hover, .back-link a:hover {
  color: var(--accent);
}

/* Member Selection */
.member-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.member-btn {
  padding: 16px 20px;
  background: var(--accent-light);
  color: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.member-btn:hover {
  background: var(--accent);
  color: white;
}

.parent-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.parent-login input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  text-align: center;
}

/* Admin Screen */
.admin-screen {
  max-width: 600px;
  margin: 0 auto;
}

.admin-screen header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.admin-screen header a {
  color: var(--text-muted);
  text-decoration: none;
}

.admin-screen header a:hover {
  color: var(--accent);
}

.admin-login {
  max-width: 300px;
  margin: 60px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-login input {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  text-align: center;
}

.admin-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.family-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.family-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.family-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.family-code {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: monospace;
}

.family-members {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Member Management */
.member-management {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.member-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.member-tag.parent {
  background: var(--success-light);
  color: var(--success);
}

.btn-remove-member {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.6;
}

.btn-remove-member:hover {
  opacity: 1;
}

.add-member-form {
  display: flex;
  gap: 8px;
}

.add-member-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

/* Member Progress List */
.member-progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.member-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.member-progress-row .member-name {
  font-weight: 500;
  min-width: 80px;
}

.member-progress-row .member-stats {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.member-actions {
  display: flex;
  gap: 6px;
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
}

.btn-small.btn-did-it {
  background: var(--success);
  color: white;
  border: none;
}

.btn-small.btn-didnt-do-it {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-small.btn-mark-complete {
  background: var(--accent);
  color: white;
  border: none;
}

.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Count Mini Progress */
.count-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.count-mini span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.count-bar-mini {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

@media (max-width: 600px) {
  .entry-screen {
    margin: 40px 16px;
    padding: 24px;
  }

  .member-progress-row {
    flex-wrap: wrap;
  }

  .member-actions {
    width: 100%;
    margin-top: 8px;
  }

  .btn-small {
    flex: 1;
    padding: 10px;
  }
}
