/* 남쌤 국어관 코칭 대시보드 — 스타일시트 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  background: #f5f6fa; color: #222; line-height: 1.6;
}
.container { max-width: 900px; margin: 0 auto; padding: 20px 16px; }

/* ── 공통 ── */
h1 { font-size: 1.8rem; margin-bottom: 4px; }
.subtitle { color: #888; font-size: 0.9rem; margin-bottom: 24px; }
.back { display: inline-block; margin-bottom: 16px; color: #4a6cf7; text-decoration: none; font-size: 0.9rem; }
.back:hover { text-decoration: underline; }

/* ── 상단 바 ── */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.logout-btn {
  background: #f0f1f5; color: #666; border: none; border-radius: 8px;
  padding: 6px 16px; font-size: 0.85rem; cursor: pointer; text-decoration: none;
}
.logout-btn:hover { background: #e0e1e5; }
.welcome { font-size: 0.9rem; color: #666; }

/* ── 로그인 ── */
.login-box {
  background: #fff; border-radius: 16px; padding: 40px 32px; margin: 40px auto;
  max-width: 480px; box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}
.login-box h2 { margin-bottom: 20px; text-align: center; }
.login-hint {
  margin-top: 24px; padding: 16px; background: #f8f9fa; border-radius: 10px;
  font-size: 0.85rem; color: #666;
}
.login-hint p { margin-bottom: 4px; }

/* ── 학생 카드 ── */
.role-select { display: flex; gap: 20px; margin-top: 30px; flex-wrap: wrap; }
.role-card {
  flex: 1; min-width: 200px; max-width: 400px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 36px 24px; border-radius: 16px; text-decoration: none; color: #222;
  background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.role-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.role-card span { font-size: 1.3rem; font-weight: 700; }
.role-card small { color: #888; }
.role-card.teacher { border-top: 4px solid #4a6cf7; }
.role-card.parent { border-top: 4px solid #e17055; }

.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.student-card {
  background: #fff; border-radius: 12px; padding: 16px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid #eee;
}
.student-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.student-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.grade { font-size: 0.8rem; color: #888; font-weight: 400; }
.sibling { font-size: 0.8rem; color: #aaa; font-weight: 400; }
.student-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.badge.level { background: #4a6cf7; color: #fff; }
.badge.goal { background: #fff3cd; color: #856404; }
.badge.x-badge { background: #fde8e8; color: #e74c3c; }
.badge.star-badge { background: #fff3cd; color: #856404; }
.badge.follow-badge { background: #d4edda; color: #155724; }
.badge.attend-badge { background: #e8f0fd; color: #4a6cf7; }
.badge.ok-badge { background: #d4edda; color: #155724; }
.badge.dollar-badge { background: #fff8e1; color: #f57f17; }
.parent-card { border-left: 4px solid #e17055; }

/* ── 학생 헤더 ── */
.student-header { margin-bottom: 24px; }
.goal-banner {
  display: inline-block; margin-top: 8px;
  padding: 8px 16px; border-radius: 20px;
  background: linear-gradient(135deg, #f8d7da, #fce4ec);
  color: #c0392b; font-weight: 600; font-size: 0.95rem;
}

/* ── 이달의 목표 (학부모 맨 위 고정) ── */
.goal-banner-top {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; padding: 14px 20px; border-radius: 12px;
  margin-bottom: 20px; box-shadow: 0 4px 16px rgba(102,126,234,0.3);
}
.goal-icon { font-size: 1.8rem; }
.goal-title { font-size: 0.8rem; opacity: 0.9; }
.goal-detail { font-size: 1.1rem; font-weight: 700; }

/* ── 요약 ── */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 30px; }
.summary-card {
  background: #fff; border-radius: 12px; padding: 16px 12px;
  text-align: center; border: 1px solid #eee;
}
.summary-num { font-size: 1.6rem; font-weight: 800; color: #4a6cf7; }
.summary-label { font-size: 0.75rem; color: #888; margin-top: 4px; }

/* ── 섹션 ── */
.section { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; border: 1px solid #eee; }
.section h2 { font-size: 1.2rem; margin-bottom: 12px; }
.chart-desc { color: #888; font-size: 0.85rem; margin-bottom: 16px; }
.chart-desc.warning { color: #e74c3c; }

/* ── 입력 폼 ── */
.input-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; }
.form-row input, .form-row select {
  padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 0.95rem; width: 220px;
}
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-group label { font-size: 0.9rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.btn-group input[type="radio"] { width: auto; }
.btn-primary {
  background: #4a6cf7; color: #fff; border: none; border-radius: 8px;
  padding: 12px 32px; font-size: 1rem; cursor: pointer; align-self: flex-start;
}
.btn-primary:hover { background: #3a5bef; }
.btn-small {
  background: #4a6cf7; color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 0.9rem; cursor: pointer;
}
.btn-small:hover { background: #3a5bef; }
.btn-small:disabled, .btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.btn-dollar {
  background: #ff9800; color: #fff; border: none; border-radius: 12px;
  padding: 16px 40px; font-size: 1.2rem; cursor: pointer; font-weight: 700;
}
.btn-dollar:hover { background: #f57c00; }

/* ── 테이블 ── */
.data-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.data-table th { background: #f0f1f5; padding: 8px 12px; text-align: left; font-size: 0.85rem; border-bottom: 2px solid #ddd; }
.data-table td { padding: 8px 12px; border-bottom: 1px solid #eee; font-size: 0.9rem; }

/* ── 차트 ── */
.chart-container { display: flex; gap: 20px; align-items: flex-end; min-height: 200px; padding: 10px 0; overflow-x: auto; }
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 80px; }
.chart-label { font-size: 0.8rem; color: #666; }
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.bar { width: 28px; border-radius: 4px 4px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 4px; font-size: 0.7rem; color: #fff; font-weight: 600; }
.x-bar { background: #e74c3c; }
.star-bar { background: #f39c12; }
.follow-bar { width: 64px; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.follow-fill { height: 100%; background: #27ae60; transition: width 0.3s; }
.follow-label { font-size: 0.7rem; color: #666; }

/* ── 사진 업로드 단계 ── */
.photo-flow { display: flex; flex-direction: column; gap: 0; }
.photo-step {
  background: #f8f9fa; border-radius: 12px; padding: 16px; margin-bottom: 0;
  transition: opacity 0.3s;
}
.photo-step.disabled { opacity: 0.4; pointer-events: none; }
.step-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; background: #4a6cf7; color: #fff;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.step-desc { font-size: 0.85rem; color: #555; }
.photo-upload-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.upload-form { display: flex; gap: 8px; align-items: center; }
.upload-form.form-disabled { opacity: 0.5; pointer-events: none; }
.upload-form input[type="file"] { font-size: 0.85rem; }
.photo-gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-thumb-wrap { position: relative; }
.photo-img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 2px solid #ddd; }
.photo-img-sm { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; }
.photo-empty { color: #aaa; font-size: 0.85rem; padding: 8px; }
.photo-count { font-size: 0.8rem; color: #888; margin-top: 8px; }
.photo-divider {
  text-align: center; padding: 8px; font-size: 0.85rem; color: #999;
  margin: 4px 0; border-top: 1px dashed #ddd; border-bottom: 1px dashed #ddd;
}
.photo-divider.locked { color: #e74c3c; }

/* ── 기록 행 ── */
.record-list { display: flex; flex-direction: column; gap: 12px; }
.record-row {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 10px; background: #f9fafb;
}
.record-date { font-weight: 700; color: #555; min-width: 80px; }
.record-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.record-photos { display: flex; gap: 16px; flex-wrap: wrap; width: 100%; margin-top: 8px; }
.photo-phase { display: flex; flex-direction: column; gap: 4px; }
.phase-label { font-size: 0.75rem; color: #888; font-weight: 600; }
.photo-thumb { font-size: 1.5rem; }

/* ── 반응형 ── */
@media (max-width: 600px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }
  .role-select { flex-direction: column; }
  .photo-upload-row { flex-direction: column; }
}
