:root {
  --primary: #2e7d32;
  --primary-light: #4caf50;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6c757d;
  --border: #e2e8f0;
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, #1b5e20, #388e3c);
  color: white;
  padding: 24px 20px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.app-header h1 { font-size: 1.7rem; margin-bottom: 4px; }
.app-header p { opacity: 0.9; font-size: 0.95rem; }

.quick-stats {
  display: flex;
  justify-content: space-around;
  background: #e8f5e9;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.quick-stats.hidden { display: none; }
.stat { text-align: center; }

.container { flex: 1; padding: 16px; max-width: 700px; margin: 0 auto; width: 100%; }

.stage-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
  transition: var(--transition);
}
.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid var(--border);
}
.stage-header h2 { font-size: 1.1rem; color: var(--primary); }
.phase-tag {
  background: #e8f5e9;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.stage-toggle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f8e9;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--primary);
  transition: transform 0.3s ease;
}
.stage-card.active .stage-toggle { transform: rotate(180deg); }

.stage-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: max-height 0.45s ease, padding 0.3s ease;
}
.stage-card.active .stage-content { max-height: 1200px; padding-bottom: 20px; }

.section-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
  border-bottom: 2px solid #e8f5e9;
  padding-bottom: 4px;
}

.task-list { list-style: none; }
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5;
}
.custom-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.custom-checkbox.checked { background: var(--primary); }
.custom-checkbox.checked::after { content: "✓"; color: white; font-size: 14px; font-weight: bold; }
.task-text { flex: 1; font-size: 0.95rem; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.metric-box {
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
}
.metric-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.metric-value { font-weight: 600; color: var(--primary); }

.info-row { display: flex; gap: 12px; margin-top: 12px; }
.info-chip {
  background: #e8f5e9; padding: 8px 14px; border-radius: 20px; font-size: 0.85rem;
}

.issue-card {
  background: #fff3e0; padding: 12px; border-radius: 12px; margin-top: 10px;
}
.issue-title { font-weight: 600; color: #e65100; margin-bottom: 4px; }
.issue-solution { font-size: 0.9rem; color: #bf360c; }

.notes-area {
  width: 100%; min-height: 80px; padding: 12px; border: 1px solid var(--border);
  border-radius: 12px; font-family: inherit; resize: vertical; margin-top: 12px;
}

.app-footer {
  background: white; padding: 20px; border-top: 1px solid var(--border); text-align: center;
}
.progress-bar { height: 8px; background: #e0e0e0; border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--primary); transition: width 0.5s ease; }
#progress-text { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; }
.btn-reset {
  background: #f5f5f5; border: none; padding: 14px 28px; border-radius: 30px;
  font-size: 1rem; cursor: pointer; color: var(--text); transition: var(--transition);
}
.btn-reset:hover { background: #e0e0e0; }

@media (min-width: 768px) {
  .app-header h1 { font-size: 2.2rem; }
  .container { padding: 30px; max-width: 800px; }
}
