That /* Modern CSS Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #2d3748;
  line-height: 1.6;
}

.container {
  max-width: 420px;
  margin: 1rem auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Desktop optimizations */
@media (min-width: 768px) {
  .container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2.5rem;
  }
  
  .star-count {
    font-size: 5rem;
  }
  
  .chart-container {
    height: 250px;
  }
  
  .chart-stats {
    grid-template-columns: 1fr;
  }
  
  .stat-metrics {
    gap: 1rem;
  }
  
  .metric-value {
    font-size: 1.4rem;
  }
}

/* iPad and tablet optimizations */
@media (min-width: 601px) and (max-width: 1024px) {
  .container {
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 2rem;
  }
  
  .chart-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .star-actions {
    flex-direction: row;
    gap: 1rem;
  }
  
  .form-row {
    flex-direction: row;
    gap: 1rem;
  }
}

/* Large desktop optimizations */
@media (min-width: 1025px) {
  .container {
    max-width: 600px;
    margin: 3rem auto;
    padding: 3rem;
  }
  
  .star-total {
    padding: 2.5rem;
  }
  
  .star-count {
    font-size: 5.5rem;
  }
  
  .chart-container {
    height: 280px;
  }
  
  .chart-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .stat-metrics {
    gap: 1.25rem;
  }
  
  .metric-value {
    font-size: 1.5rem;
  }
  
  .recent-activity li {
    padding: 1.25rem;
  }
  
  .target-history li {
    padding: 1.25rem;
  }
}

/* Header Styles */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d3748;
  background: linear-gradient(45deg, #667eea, #764ba2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions { display: flex; gap: 0.5rem; align-items: center; }
.link-btn {
  padding: 0.5rem 1rem;
  background: #ebf4ff;
  color: #2b6cb0;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid #c3dafe;
}
.link-btn:hover { background: #c3dafe; transform: translateY(-2px); }

.logout {
  padding: 0.5rem 1rem;
  background: #fed7e2;
  color: #b83280;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid #fbb6ce;
}

.logout:hover {
  background: #fbb6ce;
  transform: translateY(-2px);
}

/* Star Display */
.star-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(253, 203, 110, 0.3);
  position: relative;
  overflow: hidden;
}

.star-total::before {
  content: '⭐';
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  opacity: 0.3;
}

.star-count {
  font-size: 4.5rem;
  font-weight: 900;
  color: #2d3748;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 0.5rem;
}

.star-label {
  font-size: 1.2rem;
  color: #4a5568;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
/* Form Styles */
.star-form {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f7fafc;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

.star-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.star-form button {
  flex: 1;
  padding: 1rem 0;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.star-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s;
}

.star-form button:hover::before {
  left: 100%;
}

.star-form button.add {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
  box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.star-form button.add:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

.star-form button.remove {
  background: linear-gradient(135deg, #f56565, #e53e3e);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.star-form button.remove:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 101, 101, 0.6);
}

.star-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
}

.star-form input[type="text"] {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  outline: none;
}

.star-form input[type="text"]:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.required {
  color: #e53e3e;
  font-weight: 700;
}
/* Error Styles */
.error {
  background: linear-gradient(135deg, #fed7e2, #fbb6ce);
  color: #b83280;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 600;
  border: 1px solid #f687b3;
}

/* Success Styles */
.success {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #38a169;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 600;
  border: 1px solid #9ae6b4;
  text-align: center;
  font-size: 1.1rem;
}

/* Activity Section */
.recent-activity {
  margin-top: 2rem;
}

.recent-activity h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #2d3748;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recent-activity h2::before {
  content: '📋';
  font-size: 1.2rem;
}

.recent-activity ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-activity li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.recent-activity li:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.recent-activity .date {
  color: #718096;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 120px;
  background: #f7fafc;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.recent-activity .action.added, .recent-activity .action.add {
  color: #38a169;
  font-weight: 700;
  background: #f0fff4;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #9ae6b4;
}

.recent-activity .action.removed, .recent-activity .action.remove {
  color: #e53e3e;
  font-weight: 700;
  background: #fff5f5;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #feb2b2;
}

.recent-activity .action.reset {
  color: #805ad5;
  font-weight: 700;
  background: #faf5ff;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #d6bcfa;
}

.recent-activity .reason {
  flex: 1;
  color: #2d3748;
  font-weight: 500;
  min-width: 200px;
}

.recent-activity .by {
  color: #4a5568;
  font-size: 0.9rem;
  font-weight: 600;
  background: #edf2f7;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}
/* Chart Section */
.star-giver-chart {
  margin-top: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.star-giver-chart h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #2d3748;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.chart-container {
  margin-bottom: 1.5rem;
  height: 200px;
  position: relative;
}

.chart-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mum-stat {
  background: linear-gradient(135deg, #e6f3ff, #cce7ff);
  border-color: #667eea;
}

.dad-stat {
  background: linear-gradient(135deg, #ffe6f3, #ffcce7);
  border-color: #f5576c;
}

.total-stat {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border-color: #fdcb6e;
}

.stat-icon {
  font-size: 2rem;
  line-height: 1;
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.5rem;
}

.stat-metrics {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.metric.net {
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.metric-value.added {
  color: #38a169;
}

.metric-value.removed {
  color: #e53e3e;
}

.metric-value.net-value.positive {
  color: #38a169;
}

.metric-value.net-value.negative {
  color: #e53e3e;
}

.metric-label {
  font-size: 0.7rem;
  color: #718096;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: #2d3748;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-description {
  font-size: 0.8rem;
  color: #718096;
  font-weight: 500;
}

/* Target Progress Section */
.target-progress {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.target-progress h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #2d3748;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.target-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.target-reward {
  padding: 1rem;
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  border-radius: 12px;
  color: #2d3748;
  font-size: 1.1rem;
  text-align: center;
  border: 2px solid #f39c12;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #48bb78, #38a169);
  border-radius: 10px;
  transition: width 0.5s ease;
  min-width: 0;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #2d3748;
}

.progress-percentage {
  color: #4a5568;
  font-size: 0.9rem;
}

.target-achieved {
  padding: 1rem;
  background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
  color: #38a169;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
  border: 2px solid #68d391;
  animation: pulse 2s infinite;
}

.stars-remaining {
  padding: 0.75rem;
  background: #f7fafc;
  color: #4a5568;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

/* Set Target Section */
.set-target {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.set-target h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #2d3748;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.target-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
}

.form-group input[type="number"],
.form-group input[type="text"] {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  outline: none;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.set-target-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.set-target-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Pulse animation for achieved target */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Mobile Responsive - Enhanced for iPhone */
@media (max-width: 600px) {
  body {
    margin: 0;
    padding: 0;
  }
  
  .container {
    max-width: 100vw;
    margin: 0;
    padding: 1rem;
    border-radius: 0;
    min-height: 100vh;
    box-shadow: none;
  }
  
  header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  header h1 {
    font-size: 1.3rem;
    flex: 1;
    min-width: 200px;
  }
  
  .logout {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .star-total {
    margin-bottom: 1.5rem;
    padding: 1.5rem 1rem;
  }
  
  .star-count {
    font-size: 3rem;
  }
  
  .star-label {
    font-size: 1rem;
  }
  
  .star-form {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  
  .star-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .star-form button {
    padding: 1rem;
    font-size: 1rem;
  }
  
  .star-form input[type="text"] {
    padding: 0.875rem;
    font-size: 1rem;
  }
  
  .target-progress,
  .set-target,
  .star-giver-chart,
  .target-history,
  .recent-activity {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
  
  .target-progress h2,
  .set-target h2,
  .star-giver-chart h2,
  .target-history h2,
  .recent-activity h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-group {
    min-width: auto;
  }
  
  .form-group input {
    padding: 0.875rem;
    font-size: 1rem;
  }
  
  .set-target-btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    align-self: stretch;
  }
  
  .target-reward {
    font-size: 1rem;
    padding: 0.875rem;
  }
  
  .target-achieved {
    font-size: 1.1rem;
    padding: 0.875rem;
  }
  
  .recent-activity li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.875rem;
  }
  
  .recent-activity .date {
    min-width: auto;
    align-self: flex-end;
    font-size: 0.8rem;
  }
  
  .recent-activity .reason {
    min-width: auto;
    order: -1;
    font-weight: 600;
  }
  
  .recent-activity .action {
    align-self: flex-start;
  }
  
  .target-history li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
  }
  
  .target-stars,
  .target-reward-desc,
  .target-creator {
    min-width: auto;
  }
  
  .target-status {
    align-items: flex-start;
  }

  .chart-stats {
    gap: 0.75rem;
  }
  
  .stat-item {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .stat-icon {
    font-size: 1.5rem;
  }
  
  .stat-metrics {
    gap: 0.5rem;
  }
  
  .metric-value {
    font-size: 1rem;
  }
  
  .metric-label {
    font-size: 0.65rem;
  }
  
  .chart-container {
    height: 180px;
  }
}

/* Safe area adjustments for iPhone with notch */
@supports (padding: max(0px)) {
  @media (max-width: 600px) {
    .container {
      padding-left: max(1rem, env(safe-area-inset-left));
      padding-right: max(1rem, env(safe-area-inset-right));
      padding-top: max(1rem, env(safe-area-inset-top));
      padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
  }
}

/* Login Page Styles */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-page .container {
  margin: 0 auto;
  text-align: center;
  max-width: 500px;
  padding: 2.5rem;
}

.login-page h1 {
  margin-bottom: 2rem;
  color: #2d3748;
  font-size: 2rem;
}

.login-page form {
  margin-top: 2rem;
}

.login-page label {
  display: block;
  margin-bottom: 0.5rem;
  text-align: left;
  font-weight: 600;
  color: #4a5568;
}

.login-page input[type="text"],
.login-page input[type="password"] {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: white;
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
}

.login-page input[type="text"]:focus,
.login-page input[type="password"]:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-page button {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

.login-page button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.login-info {
  margin-top: 2rem;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 12px;
  color: #4a5568;
  font-size: 0.9rem;
  text-align: center;
}

.login-info strong {
  font-weight: 600;
}

@media (min-width: 640px) {
  .login-info {
    text-align: left;
  }
}

main .container {
  display: flex;
  align-items: center;
}

/* Error and 404 Pages */
.error-page .container,
.not-found .container {
  text-align: center;
  margin-top: 10vh;
}

.error-page h1,
.not-found h1 {
  color: #e53e3e;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.error-page a,
.not-found a {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.error-page a:hover,
.not-found a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

.container {
  animation: fadeIn 0.6s ease-out;
}

/* Focus states for accessibility */
button:focus,
input:focus,
a:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Loading states */
.star-form button:active {
  transform: translateY(1px);
}

/* Target History Section */
.target-history {
  margin-top: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.target-history h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #2d3748;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.target-history ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.target-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.target-history li.achieved {
  background: linear-gradient(135deg, #f0fff4, #c6f6d5);
  border-color: #9ae6b4;
}

.target-history li.not-achieved {
  background: linear-gradient(135deg, #fef5e7, #fed7aa);
  border-color: #fdba74;
}

.target-history li:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.target-stars {
  font-weight: 700;
  color: #2d3748;
  background: #edf2f7;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 80px;
  text-align: center;
}

.achieved-stars {
  display: block;
  font-weight: 500;
  color: #38a169;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  background: #f0fff4;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #9ae6b4;
}

.target-reward-desc {
  flex: 1;
  color: #2d3748;
  font-weight: 500;
  min-width: 150px;
}

.target-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.achieved-badge {
  background: #38a169;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.period-info {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #718096;
  background: #f7fafc;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.current-badge {
  background: #ed8936;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.achieved-date {
  color: #4a5568;
  font-size: 0.8rem;
}

.target-creator {
  color: #4a5568;
  font-size: 0.85rem;
  background: #f7fafc;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

/* Mobile adjustments for target history */
@media (max-width: 600px) {
  .target-history li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .target-stars {
    min-width: auto;
  }
  
  .target-reward-desc {
    min-width: auto;
  }
  
  .target-status {
    align-items: flex-start;
  }
}

/* Touch and interaction improvements for mobile */
@media (max-width: 600px) {
  /* Improve touch targets */
  button, input, a {
    min-height: 44px; /* Apple's recommended minimum touch target */
  }
  
  /* Better touch feedback */
  .star-form button:active {
    transform: translateY(2px) scale(0.98);
  }
  
  .stat-item:active {
    transform: scale(0.98);
  }
  
  /* Smooth scrolling for better UX */
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Prevent zoom on input focus */
  input[type="text"], 
  input[type="number"], 
  input[type="password"] {
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  /* Better spacing for thumb navigation */
  .recent-activity li,
  .target-history li {
    margin-bottom: 0.5rem;
  }
  
  /* Improve chart interaction on touch */
  .chart-container {
    position: relative;
    touch-action: pan-y;
  }
  
  /* Better progress bar visibility */
  .progress-bar {
    height: 24px;
  }
  
  .progress-fill {
    border-radius: 12px;
  }
}

/* High-DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2) {
  .star-count {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }
}

/* Landscape phone optimizations */
@media (max-width: 896px) and (orientation: landscape) {
  .container {
    padding: 0.75rem;
  }
  
  .star-total {
    padding: 1rem;
  }
  
  .star-count {
    font-size: 2.5rem;
  }
  
  .chart-container {
    height: 150px;
  }
}

@media (max-width: 600px) {
  .login-page .container {
    padding: 1.5rem;
    max-width: 100%;
  }
  
  .login-page h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }
  
  .login-page form {
    margin-top: 1.5rem;
  }
  
  .login-page input[type="text"],
  .login-page input[type="password"] {
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    box-sizing: border-box;
    display: block;
    margin-bottom: 0.75rem;
  }
  
  .login-page button {
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.6rem;
    font-size: 0.95rem;
    box-sizing: border-box;
    display: block;
  }
  
  .login-info {
    margin-top: 1.5rem;
    font-size: 0.85rem;
  }
}

/* Savings Summary Styles */
.savings-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.summary-card {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}

.summary-card .label {
  color: #4a5568;
  font-size: 0.9rem;
}

.summary-card .value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2d3748;
}

/* Make the Target card (first tile) red */
.savings-summary .summary-card:first-child {
  background: linear-gradient(135deg, #ff9aa2, #ff6b6b);
  border-color: #feb2b2;
}
.savings-summary .summary-card:first-child .label,
.savings-summary .summary-card:first-child .value {
  color: #fff;
}

/* Turn target card green when reached */
.savings-summary .summary-card:first-child.target-reached {
  background: linear-gradient(135deg, #68d391, #48bb78);
  border-color: #9ae6b4;
}
.savings-summary .summary-card:first-child.target-reached .label,
.savings-summary .summary-card:first-child.target-reached .value {
  color: #fff;
}

/* Saved tile: change hue via filter in 5% steps (0deg..120deg) */
.saved-card {
  background: linear-gradient(135deg, #ff9aa2, #ff6b6b);
  border-color: #feb2b2;
  color: #fff;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.saved-card .label,
.saved-card .value { color: #fff; }
