/* ========================================
   MONOGRAMI Design System
   Premium Sports Academy Management
   ======================================== */

/* --- CSS Variables --- */
:root {
  --navy: #0F172A;
  --navy-light: #1E293B;
  --blue-900: #1B3A7B;
  --blue-700: #1B65E3;
  --blue-500: #3B82F6;
  --blue-400: #4D8EF7;
  --blue-100: #E8F0FE;
  --blue-50: #F0F5FF;
  --mint: #22C997;
  --mint-light: #D1FAE5;
  --green: #27AE60;
  --green-light: #E8F5E9;
  --orange: #E67E22;
  --orange-light: #FFF3E0;
  --red: #E74C3C;
  --red-light: #FCE4EC;
  --purple: #8E44AD;
  --purple-light: #F3E5F5;
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #94A3B8;
  --gray-300: #CBD5E1;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50: #F8FAFC;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 6px rgba(15,23,42,0.04), 0 2px 8px rgba(15,23,42,0.08);
  --shadow-lg: 0 10px 25px rgba(15,23,42,0.06), 0 4px 12px rgba(15,23,42,0.1);
  --shadow-xl: 0 20px 40px rgba(15,23,42,0.08), 0 8px 20px rgba(15,23,42,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: var(--transition);
  background: var(--white);
  color: var(--gray-900);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
table { border-collapse: collapse; width: 100%; }

/* --- Utility --- */
.required { color: var(--red); }
.positive { color: var(--mint) !important; }
.negative { color: var(--red) !important; }
.date-text { color: var(--gray-400); font-size: 0.82rem; }

/* --- Card --- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  padding: 24px;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.badge-blue { background: var(--blue-100); color: var(--blue-700); }
.badge-green { background: var(--mint-light); color: var(--mint); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-orange { background: var(--orange-light); color: var(--orange); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(27,101,227,0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(27,101,227,0.4);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger {
  background: var(--red-light);
  color: var(--red);
}
.btn-danger:hover { background: #FECDD3; }
.btn-full { width: 100%; justify-content: center; padding: 13px 20px; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.link-btn {
  color: var(--blue-700);
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}
.link-btn:hover { color: var(--blue-500); }
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  transition: var(--transition);
}
.icon-btn:hover {
  background: var(--gray-100);
  color: var(--blue-700);
}

/* --- Status Badge --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-badge.active { background: var(--mint-light); color: #15803d; }
.status-badge.active::before { background: var(--green); }
.status-badge.new { background: var(--blue-100); color: var(--blue-700); }
.status-badge.new::before { background: var(--blue-500); }
.status-badge.draft { background: var(--gray-100); color: var(--gray-500); }
.status-badge.draft::before { background: var(--gray-400); }
.status-badge.inactive { background: var(--red-light); color: var(--red); }
.status-badge.inactive::before { background: var(--red); }

/* --- Avatar --- */
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-400));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm img, .avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue-700), var(--mint));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(27,101,227,0.25);
}

/* --- Toggle --- */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-300);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--blue-700); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* --- Form --- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.form-grid .full-width { grid-column: 1 / -1; }

.file-upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  color: var(--gray-400);
  transition: var(--transition);
  cursor: pointer;
}
.file-upload-area:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}
.file-upload-area p { margin-top: 8px; font-size: 0.88rem; color: var(--gray-600); }
.file-upload-area span { font-size: 0.75rem; }

.url-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 14px;
}
.url-base { color: var(--gray-400); font-size: 0.88rem; white-space: nowrap; }
.url-input { border: none !important; background: transparent !important; box-shadow: none !important; padding: 6px !important; }

/* --- Modal / Drawer --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-lg { max-width: 680px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--gray-400);
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  gap: 10px;
}
.modal-footer-right { display: flex; gap: 10px; }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

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

/* ========================================
   APP SWITCHER (Demo only)
   ======================================== */
.app-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.switcher-btn {
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  transition: var(--transition);
}
.switcher-btn.active {
  background: var(--blue-700);
  color: var(--white);
}

/* ========================================
   STUDENT APP
   ======================================== */
.student-app { min-height: 100vh; padding-bottom: 80px; }
.student-container { max-width: 960px; margin: 0 auto; padding: 16px; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* --- Mobile Top Header --- */
.mobile-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 800;
  box-shadow: var(--shadow-sm);
}
.mobile-top-header .logo-text { font-size: 0.95rem; }
.mobile-user-badge { display: flex; align-items: center; }

/* --- Mobile Nav --- */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  z-index: 900;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  color: var(--gray-400);
  font-size: 0.68rem;
  font-weight: 500;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}
.mobile-nav-item.active {
  color: var(--blue-700);
}
.mobile-nav-item.active svg { stroke: var(--blue-700); }

/* --- PC Header --- */
.pc-header {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 800;
  box-shadow: var(--shadow-sm);
}
.pc-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-700), var(--mint));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
}
.logo-icon.large {
  width: 52px;
  height: 52px;
  font-size: 1.4rem;
  border-radius: 14px;
}
.logo-icon.small {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
  border-radius: 8px;
}
.logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
}
.pc-nav { display: flex; gap: 4px; }
.pc-nav-item {
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.pc-nav-item:hover { color: var(--gray-700); background: var(--gray-50); }
.pc-nav-item.active {
  color: var(--blue-700);
  background: var(--blue-50);
  font-weight: 600;
}
.student-badge-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

/* --- Hero --- */
.hero-section {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 20px;
  padding: 36px 28px;
  background: linear-gradient(135deg, #1B3A7B 0%, #1B65E3 50%, #22C997 100%);
  color: var(--white);
}
.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='white'/%3E%3C/svg%3E") repeat;
}
.hero-content { position: relative; z-index: 1; }
.greeting-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.hero-greeting h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}
.hero-subtitle { opacity: 0.85; font-size: 0.9rem; }

/* --- Profile --- */
.profile-card { }
.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--gray-500);
}
.last-measure { margin-top: 4px; }

/* --- Growth Summary Card --- */
.growth-summary-card { }
.growth-score-display {
  display: flex;
  align-items: center;
  gap: 24px;
}
.score-circle-home {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.score-circle-home svg { width: 100%; height: 100%; }
.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.score-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.score-unit { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.score-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.score-change span { font-weight: 700; }
.growth-comment {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.5;
  background: var(--gray-50);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--blue-500);
}

/* --- Section Row --- */
.section-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.cards-grid {
  grid-template-columns: 1fr;
}

/* --- Video Thumb --- */
.thumb-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: url('img_src/수업영상/photo-1496260106735-0ebe74742400.jpeg') center/cover no-repeat;
}
.thumb-placeholder.large { aspect-ratio: 16/8; }
.thumb-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='8' fill='none' stroke='white' stroke-width='1'/%3E%3C/svg%3E") repeat;
}
.thumb-bg-pattern.featured { opacity: 0.08; }
.thumb-bg-pattern[style*="--hue:150"] { background-color: #27AE60; }
.thumb-bg-pattern[style*="--hue:260"] { background-color: #8E44AD; }
.thumb-bg-pattern[style*="--hue:30"] { background-color: #E67E22; }
.thumb-bg-pattern[style*="--hue:340"] { background-color: #E74C3C; }
.thumb-bg-pattern[style*="--hue:180"] { background-color: #22C997; }
.thumb-placeholder[style] { }
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}
.play-icon.large { width: 64px; height: 64px; }
.thumb-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
}
.thumb-duration {
  background: rgba(0,0,0,0.7);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.video-thumb-card .thumb-placeholder { margin-bottom: 12px; }
.video-info h4, .video-card-info h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.video-meta { display: flex; align-items: center; gap: 8px; }
.video-desc { font-size: 0.82rem; color: var(--gray-500); margin-bottom: 8px; }

/* --- Notice Home Items --- */
.notice-list-home { display: flex; flex-direction: column; gap: 12px; }
.notice-item-home {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}
.notice-item-home.important { border-left: 3px solid var(--red); background: #FFF8F8; }
.notice-item-home:hover { box-shadow: var(--shadow-sm); }
.notice-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.notice-item-home h4, .notice-card h4 { font-size: 0.92rem; font-weight: 600; margin-bottom: 4px; }
.notice-item-home p, .notice-card p {
  font-size: 0.82rem;
  color: var(--gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Student Growth Page --- */
.page-title-bar {
  margin-bottom: 20px;
  padding-top: 8px;
}
.page-title-bar h2 { font-size: 1.3rem; font-weight: 800; }
.page-title-bar p { font-size: 0.88rem; color: var(--gray-500); margin-top: 2px; }

.growth-top-section { margin-bottom: 20px; }
.overall-score-card { }
.overall-score-content {
  display: flex;
  align-items: center;
  gap: 28px;
}
.score-ring-container {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.score-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.big-score { font-size: 2.8rem; font-weight: 800; color: var(--navy); line-height: 1; }
.big-score-unit { font-size: 0.82rem; color: var(--gray-400); margin-top: 4px; }
.overall-score-info h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.change-num { font-size: 1.1rem; font-weight: 700; }
.change-label { font-size: 0.85rem; color: var(--gray-500); }
.feedback-box {
  margin-top: 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.feedback-box p {
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 6px;
  line-height: 1.5;
}
.feedback-box p:last-child { margin-bottom: 0; }

/* Chart Area */
.chart-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.chart-toggle-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  transition: var(--transition);
}
.chart-toggle-btn.active {
  background: var(--blue-700);
  color: var(--white);
}
.chart-wrapper {
  position: relative;
  width: 100%;
  max-height: 300px;
  display: flex;
  justify-content: center;
}
.chart-wrapper canvas { max-width: 100%; }

/* Category Scores */
.category-score-list { display: flex; flex-direction: column; gap: 14px; }
.category-score-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.cat-info { flex: 1; min-width: 0; }
.cat-name { font-size: 0.82rem; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; display: block; }
.cat-bar-wrapper {
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.cat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.cat-score {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 60px;
  text-align: right;
}
.cat-change {
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 4px;
}

/* History */
.history-card { }
.history-table-wrapper { overflow-x: auto; }
.history-table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
}
.history-table td {
  padding: 12px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--gray-50);
}
.score-cell { font-weight: 700; color: var(--navy); }
.change-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.change-badge.positive { background: var(--mint-light); color: var(--green); }
.change-badge.negative { background: var(--red-light); color: var(--red); }
.detail-btn {
  font-size: 0.78rem;
  color: var(--blue-700);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.detail-btn:hover { background: var(--blue-50); }

/* Detail Modal */
.detail-date { font-size: 0.88rem; color: var(--gray-500); margin-bottom: 16px; }
.detail-scores { display: flex; flex-direction: column; gap: 12px; }
.detail-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}
.detail-score-row > span:first-child { width: 60px; font-weight: 600; color: var(--gray-700); }
.detail-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--gray-100);
  border-radius: 5px;
  overflow: hidden;
}
.detail-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-700), var(--mint));
  border-radius: 5px;
}
.detail-val { font-weight: 700; color: var(--navy); min-width: 44px; text-align: right; }
.detail-total {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  font-size: 1rem;
  text-align: center;
}
.detail-total strong { font-size: 1.2rem; color: var(--blue-700); }

/* --- Video Page --- */
.featured-video-card {
  position: relative;
  overflow: hidden;
}
.featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  background: var(--red);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
}
.featured-thumb { margin: -24px -24px 16px -24px; }
.featured-info h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.featured-info p { font-size: 0.88rem; color: var(--gray-600); margin-bottom: 10px; }

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}
.video-card { padding: 0; overflow: hidden; }
.video-card .thumb-placeholder { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.video-card-info { padding: 14px 16px; }
.video-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* --- Notices Page --- */
.important-notice-highlight {
  display: flex;
  gap: 14px;
  border-left: 4px solid var(--red);
  background: linear-gradient(135deg, #FFF8F8, var(--white));
  margin-bottom: 16px;
}
.important-icon { font-size: 1.5rem; flex-shrink: 0; }
.important-content h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.important-content p { font-size: 0.88rem; color: var(--gray-600); margin-bottom: 8px; }

.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-card {
  cursor: pointer;
  transition: var(--transition);
}
.notice-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Notice Detail */
.notice-detail-view {
  position: fixed;
  inset: 0;
  background: var(--gray-50);
  z-index: 950;
  overflow-y: auto;
  padding-top: 16px;
  padding-bottom: 80px;
  animation: fadeIn 0.3s ease;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue-700);
  margin-bottom: 16px;
  padding: 6px 0;
}
.notice-detail-header {
  margin-bottom: 20px;
}
.notice-detail-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 10px 0 6px;
}
.notice-detail-body {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--gray-700);
}
.notice-detail-body ul {
  padding-left: 20px;
  margin: 4px 0;
}
.notice-detail-body li { margin-bottom: 4px; }
.notice-detail-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}
.attachment-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--blue-700);
  cursor: pointer;
  transition: var(--transition);
}
.attachment-area:hover { background: var(--blue-50); }

/* ========================================
   ADMIN APP
   ======================================== */
.admin-app { min-height: 100vh; }

/* --- Admin Login --- */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A, #1B3A7B);
  position: relative;
  overflow: hidden;
}
.login-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ccircle cx='40' cy='40' r='20' fill='none' stroke='white' stroke-width='0.5'/%3E%3C/svg%3E") repeat;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  margin: 0 auto 14px;
}
.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.login-logo p { font-size: 0.88rem; color: var(--gray-500); }
.login-form { margin-bottom: 16px; }
.login-form .form-group { margin-bottom: 16px; }
.login-footer-text {
  text-align: center;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 16px;
}

/* --- Admin Layout --- */
.admin-main {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 240px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 850;
  transition: var(--transition);
}
.sidebar-logo {
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-text { color: var(--white); }
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.55);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  width: 100%;
  text-align: left;
}
.sidebar-nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}
.sidebar-nav-item.active {
  color: var(--white);
  background: rgba(59,130,246,0.25);
}
.sidebar-nav-item svg { flex-shrink: 0; }
.sidebar-bottom {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.logout-btn { color: rgba(255,255,255,0.4) !important; }
.logout-btn:hover { color: var(--red) !important; background: rgba(231,76,60,0.1) !important; }

.admin-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  z-index: 840;
  padding: 0 16px;
  align-items: center;
  gap: 12px;
}
.hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
}

.admin-content {
  flex: 1;
  margin-left: 240px;
  padding: 28px 32px;
  min-height: 100vh;
  background: var(--gray-50);
}
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; animation: fadeIn 0.3s ease; }

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-page-header h1 { font-size: 1.4rem; font-weight: 800; }
.admin-page-header p { font-size: 0.88rem; color: var(--gray-500); margin-top: 2px; }
.header-date { font-size: 0.88rem; color: var(--gray-400); font-weight: 500; }

/* --- KPI --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-label { font-size: 0.78rem; color: var(--gray-500); display: block; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); display: block; line-height: 1.2; }
.kpi-sub { font-size: 0.75rem; color: var(--gray-400); }
.kpi-sub.positive { color: var(--mint); }

/* --- Quick Actions --- */
.quick-actions { margin-bottom: 28px; }
.quick-actions h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: var(--transition);
}
.quick-action-btn:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
  color: var(--blue-700);
}
.quick-action-btn svg { color: var(--blue-500); flex-shrink: 0; }

/* --- Admin Lists --- */
.admin-section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-card { }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.admin-list-item:hover { background: var(--gray-50); }
.list-item-info { flex: 1; min-width: 0; }
.list-item-info strong { display: block; font-size: 0.88rem; }
.list-item-info span { font-size: 0.78rem; color: var(--gray-400); }

.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}
.activity-info { flex: 1; }
.activity-info span { display: block; font-size: 0.85rem; }
.activity-info .date-text { font-size: 0.75rem; margin-top: 2px; }

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.search-input {
  padding-left: 38px !important;
}
.filter-select {
  min-width: 140px;
  width: auto;
}

/* --- Admin Table --- */
.table-card { padding: 0; overflow: hidden; }
.table-wrapper { overflow-x: auto; }
.admin-table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  padding: 14px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--gray-50);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--gray-50); }
.table-user, .table-video {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-sub { display: block; font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.table-thumb {
  width: 60px;
  height: 40px;
  border-radius: 6px;
  background: url('img_src/수업영상/photo-1496260106735-0ebe74742400.jpeg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.mini-play {
  color: var(--white);
  font-size: 0.65rem;
}

/* --- Growth Admin --- */
.growth-admin-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
}
.growth-admin-left { display: flex; flex-direction: column; gap: 16px; }
.student-select-area { }
.student-select-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.student-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.student-select-item:hover { background: var(--gray-50); }
.student-select-item.active {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
}
.student-select-item strong { display: block; font-size: 0.88rem; }
.student-select-item span { font-size: 0.78rem; color: var(--gray-400); }

.growth-history-admin { display: flex; flex-direction: column; gap: 6px; }
.growth-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.growth-history-item:hover { background: var(--gray-50); }
.growth-history-item.active { background: var(--blue-50); border: 1px solid var(--blue-100); }
.history-round {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.history-info { flex: 1; }
.history-info span { display: block; font-size: 0.75rem; color: var(--gray-400); }
.history-info strong { font-size: 0.92rem; }
.history-actions { display: flex; gap: 4px; }

/* Preview */
.preview-card { }
.preview-content { }
.preview-frame {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}
.preview-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--blue-700) 0deg, var(--mint) 295deg, var(--gray-200) 295deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
}
.preview-score-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--gray-50);
  border-radius: 50%;
}
.preview-score {
  position: relative;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
}
.preview-score span { font-size: 0.75rem; color: var(--gray-400); font-weight: 500; }
.preview-bars { margin-bottom: 14px; }
.preview-bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.78rem;
}
.preview-bar-item > span:first-child { width: 45px; color: var(--gray-600); text-align: left; }
.preview-bar-item > span:last-child { width: 25px; font-weight: 700; color: var(--navy); text-align: right; }
.preview-bar-track {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.preview-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-700), var(--mint));
  border-radius: 3px;
}
.preview-feedback {
  font-size: 0.82rem;
  color: var(--gray-600);
  font-style: italic;
}

/* Score Input Section */
.score-input-section { margin-top: 12px; }
.score-input-section h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gray-700);
}
.score-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.score-input-item {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.score-input-item label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.score-input-item input {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 8px;
}
.score-input { font-size: 1rem; font-weight: 700; }

/* Thumb preview in video form */
.thumb-preview-area {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.preview-thumb {
  width: 200px;
  aspect-ratio: 16/9;
  flex-shrink: 0;
}

/* ========================================
   RESPONSIVE - Mobile First
   ======================================== */

/* ---- Base mobile (all phones, <640px) ---- */

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .icon-btn { width: 40px; height: 40px; }
  .mobile-nav-item { min-height: 50px; min-width: 60px; }
  input, select, textarea { min-height: 44px; font-size: 16px; } /* 16px prevents iOS zoom */
  .detail-btn { min-height: 36px; padding: 6px 14px; }
  .filter-select { min-height: 44px; }
}

/* Mobile bottom nav - improved */
.mobile-nav {
  padding-bottom: max(env(safe-area-inset-bottom, 8px), 8px);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

/* Student container mobile */
.student-container { padding: 12px; }

/* Hero mobile compact */
.hero-section { padding: 24px 18px; margin-bottom: 14px; border-radius: var(--radius-lg); }
.hero-greeting h1 { font-size: 1.2rem; }
.hero-subtitle { font-size: 0.82rem; }
.greeting-badge { font-size: 0.72rem; padding: 4px 10px; margin-bottom: 8px; }

/* Cards mobile - tighter spacing */
.card { padding: 16px; border-radius: var(--radius-md); }
.card-header { margin-bottom: 12px; }
.section-row { gap: 12px; margin-bottom: 14px; }

/* Profile card - vertical on mobile */
.profile-top {
  flex-direction: column;
  text-align: center;
  gap: 12px;
}
.profile-meta { justify-content: center; flex-wrap: wrap; }
.last-measure { justify-content: center; width: 100%; }
.profile-info h3 { font-size: 1rem; }

/* Growth summary - vertical layout */
.growth-score-display {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.score-circle-home { width: 100px; height: 100px; }
.score-value { font-size: 1.8rem; }
.score-detail { text-align: center; }
.score-change { justify-content: center; }
.growth-comment { font-size: 0.82rem; text-align: left; }

/* Overall score card - vertical */
.overall-score-content {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}
.overall-score-info { text-align: center; }
.overall-score-info .score-change { justify-content: center; }
.score-ring-container { width: 140px; height: 140px; }
.big-score { font-size: 2.2rem; }
.feedback-box { text-align: left; }
.feedback-box p { font-size: 0.82rem; }

/* Chart area - full width, shorter */
.chart-wrapper { max-height: 260px; }
.category-scores-card .category-score-list { gap: 12px; }
.cat-icon { width: 34px; height: 34px; font-size: 0.88rem; border-radius: 8px; }
.cat-score { font-size: 0.95rem; min-width: 52px; }

/* Page title bar */
.page-title-bar { margin-bottom: 14px; padding-top: 4px; }
.page-title-bar h2 { font-size: 1.15rem; }
.page-title-bar p { font-size: 0.82rem; }

/* History table - scrollable with sticky first col */
.history-table th, .history-table td { padding: 10px 8px; font-size: 0.82rem; white-space: nowrap; }

/* Video grid mobile - full width cards */
.video-grid { gap: 12px; }
.video-card-info { padding: 12px 14px; }
.video-card-info h4 { font-size: 0.88rem; }

/* Featured video */
.featured-video-card { padding: 0; }
.featured-thumb { margin: 0; }
.featured-info { padding: 16px; }
.featured-info h3 { font-size: 1rem; }
.featured-info p { font-size: 0.82rem; }

/* Notice cards */
.notice-list { gap: 10px; }
.notice-card { padding: 14px; }
.important-notice-highlight { padding: 14px; gap: 10px; }
.important-content h3 { font-size: 0.95rem; }
.important-content p { font-size: 0.82rem; }

/* Notice detail view - mobile full screen */
.notice-detail-view { padding-top: 12px; }
.notice-detail-header h2 { font-size: 1.1rem; }
.notice-detail-body { font-size: 0.88rem; line-height: 1.7; }

/* Modal mobile - full screen drawer from bottom */
.modal-overlay { align-items: flex-end; padding: 0; }
.modal-content {
  max-width: 100%;
  max-height: 92vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  animation: slideUpModal 0.3s ease;
}
.modal-header { padding: 16px 18px; }
.modal-header h3 { font-size: 0.95rem; }
.modal-body { padding: 16px 18px; }
.modal-footer { padding: 14px 18px; }

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

/* Form mobile */
.form-grid { grid-template-columns: 1fr; gap: 0; }
.file-upload-area { padding: 20px; }
.url-preview { flex-wrap: wrap; }
.score-input-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.score-input-item { padding: 10px; }
.score-input-item input { font-size: 1rem; }

/* Toast mobile - wider */
.toast {
  left: 12px;
  right: 12px;
  transform: none;
  bottom: 80px;
}

/* App switcher mobile - repositioned */
.app-switcher {
  top: auto;
  bottom: 64px;
  right: 12px;
  left: auto;
}

/* --- Desktop/Mobile visibility toggles --- */
.mobile-only { display: block; }
.desktop-only { display: none; }

/* --- Admin Mobile Bottom Nav --- */
.admin-mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--gray-200);
  padding: 4px 0 max(env(safe-area-inset-bottom, 6px), 6px);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.admin-mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 4px;
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 0.68rem;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  transition: color 0.15s;
  min-height: 44px;
}
.admin-mobile-nav-item svg { width: 22px; height: 22px; }
.admin-mobile-nav-item.active { color: var(--blue-700); font-weight: 600; }
.admin-mobile-nav-item:active { background: var(--gray-50); border-radius: 8px; }

/* --- Admin mobile logout button --- */
.admin-mobile-logout {
  background: none;
  border: 1px solid var(--gray-300);
  color: var(--gray-600);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-mobile-logout:active { background: var(--gray-50); }

/* --- Mobile Card List --- */
.mobile-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.m-card {
  padding: 14px 16px !important;
  cursor: pointer;
  transition: transform 0.1s;
}
.m-card:active { transform: scale(0.98); }
.m-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.m-card-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.m-card-user strong {
  font-size: 0.9rem;
  color: var(--gray-800);
  display: block;
  line-height: 1.3;
}
.m-card-user .date-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: block;
  margin-top: 1px;
}
.m-card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.m-card-meta {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.m-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.m-meta-label {
  font-size: 0.68rem;
  color: var(--gray-400);
  font-weight: 500;
}
.m-meta-item > span:last-child {
  font-size: 0.8rem;
  color: var(--gray-700);
  font-weight: 500;
}

/* --- Chat UI --- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 500px;
  padding: 0 !important;
  overflow: hidden;
}
.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.chat-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-header-user strong { font-size: 0.95rem; color: var(--gray-800); }
.chat-status {
  font-size: 0.72rem;
  color: var(--gray-400);
  display: block;
}
.chat-status.online { color: var(--mint); }
.chat-status.online::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--mint);
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--gray-50);
}
.chat-date-divider {
  text-align: center;
  margin: 12px 0;
}
.chat-date-divider span {
  font-size: 0.72rem;
  color: var(--gray-400);
  background: var(--white);
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: chatFadeIn 0.2s ease;
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-bubble.sent {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-bubble.received {
  align-self: flex-start;
  align-items: flex-start;
}
.chat-bubble-content {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}
.chat-bubble.sent .chat-bubble-content {
  background: var(--blue-700);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.chat-bubble.received .chat-bubble-content {
  background: var(--white);
  color: var(--gray-800);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chat-bubble-content p { margin: 0; }
.chat-time {
  font-size: 0.65rem;
  color: var(--gray-400);
  margin-top: 3px;
  padding: 0 4px;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--gray-100);
  background: var(--white);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  background: var(--gray-50);
}
.chat-input:focus { border-color: var(--blue-700); background: var(--white); }
.chat-attach-btn, .chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-attach-btn {
  background: var(--gray-50);
  color: var(--gray-500);
}
.chat-attach-btn:hover { background: var(--gray-100); }
.chat-send-btn {
  background: var(--blue-700);
  color: var(--white);
}
.chat-send-btn:hover { background: var(--blue-900); }

/* Admin Chat Layout */
.admin-chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 160px);
  min-height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.chat-list-panel {
  border-radius: 0 !important;
  box-shadow: none !important;
  border-right: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-list-header {
  padding: 14px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.chat-user-list {
  flex: 1;
  overflow-y: auto;
}
.chat-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-50);
  transition: background 0.12s;
  position: relative;
}
.chat-user-item:hover { background: var(--blue-50); }
.chat-user-item.active { background: var(--blue-50); border-left: 3px solid var(--blue-700); }
.chat-user-info { flex: 1; min-width: 0; }
.chat-user-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.chat-user-top strong { font-size: 0.88rem; color: var(--gray-800); }
.chat-time-label { font-size: 0.68rem; color: var(--gray-400); flex-shrink: 0; }
.chat-preview {
  font-size: 0.78rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.chat-unread-badge {
  background: var(--blue-700);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-window-panel {
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
}
.chat-window-panel .chat-messages {
  flex: 1;
}
.chat-back-btn {
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  padding: 4px;
  display: none;
}

/* --- Admin mobile specifics --- */
.admin-sidebar {
  transform: translateX(-100%);
}
.admin-sidebar.open {
  transform: translateX(0);
  box-shadow: var(--shadow-xl);
}
.admin-mobile-header { display: flex; }
.admin-content {
  margin-left: 0;
  padding: 66px 12px 80px;
}
.admin-page-header { margin-bottom: 16px; }
.admin-page-header h1 { font-size: 1.15rem; }
.admin-page-header .btn { padding: 8px 14px; font-size: 0.82rem; }

.kpi-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.kpi-card { padding: 14px; gap: 10px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 10px; }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-size: 1.3rem; }
.kpi-label { font-size: 0.72rem; }
.kpi-sub { font-size: 0.68rem; }

.quick-action-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-action-btn { padding: 12px; font-size: 0.82rem; flex-direction: column; text-align: center; gap: 6px; }

.admin-section-row { grid-template-columns: 1fr; gap: 12px; }

.growth-admin-layout { grid-template-columns: 1fr; }
.growth-admin-right { order: -1; } /* Preview on top in mobile */

/* Admin chat mobile */
.admin-chat-layout {
  grid-template-columns: 1fr;
  height: calc(100vh - 160px);
}
.chat-list-panel { border-right: none; }
.chat-window-panel { display: none; }
.chat-window-panel.chat-open { display: flex; position: fixed; inset: 0; z-index: 900; border-radius: 0 !important; }
.chat-back-btn { display: flex !important; }

/* Student chat mobile */
.chat-container { height: calc(100vh - 180px); min-height: 400px; }

/* Admin table mobile - horizontal scroll with shadow hint */
.table-card { border-radius: var(--radius-md); }
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.admin-table th, .admin-table td { padding: 10px 12px; font-size: 0.82rem; white-space: nowrap; }
.table-user, .table-video { min-width: 180px; }

/* Filter bar mobile */
.filter-bar { flex-direction: column; gap: 8px; }
.search-input-wrapper { min-width: 100%; }
.filter-select { width: 100%; min-width: 100%; }

/* Login mobile */
.login-card { padding: 28px 20px; margin: 16px; }
.login-logo h1 { font-size: 1.2rem; }

/* Admin overlay for mobile sidebar */
.admin-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 845;
  display: none;
}
.admin-sidebar-overlay.show { display: block; }

/* Thumb preview in forms */
.thumb-preview-area { flex-direction: column; }
.preview-thumb { width: 100%; }

/* ---- Small phones (<380px) ---- */
@media (max-width: 379px) {
  .student-container { padding: 8px; }
  .hero-section { padding: 20px 14px; }
  .hero-greeting h1 { font-size: 1.05rem; }
  .card { padding: 12px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .quick-action-grid { grid-template-columns: 1fr; }
  .score-input-grid { grid-template-columns: 1fr; }
  .badge { font-size: 0.68rem; padding: 2px 8px; }
  .mobile-nav-item { font-size: 0.62rem; padding: 6px 8px; }
  .mobile-nav-item svg { width: 20px; height: 20px; }
  .score-ring-container { width: 120px; height: 120px; }
  .big-score { font-size: 1.8rem; }
}

/* ---- Medium phones (380-479px) ---- */
@media (min-width: 380px) and (max-width: 479px) {
  .student-container { padding: 12px; }
}

/* ---- Large phones / Small tablets (480-639px) ---- */
@media (min-width: 480px) and (max-width: 639px) {
  .student-container { padding: 16px; }
  .card { padding: 18px; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .growth-score-display { flex-direction: row; text-align: left; }
  .score-detail { text-align: left; }
  .score-change { justify-content: flex-start; }
  .profile-top { flex-direction: row; text-align: left; }
  .profile-meta { justify-content: flex-start; }
  .last-measure { justify-content: flex-start; }
}

/* ---- Tablet+ (640px+) ---- */
@media (min-width: 640px) {
  .student-container { padding: 18px; }
  .card { padding: 20px; }
  .section-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .growth-score-display { flex-direction: row; text-align: left; gap: 24px; }
  .score-detail { text-align: left; }
  .score-change { justify-content: flex-start; }
  .overall-score-content { flex-direction: row; text-align: left; gap: 28px; }
  .overall-score-info { text-align: left; }
  .overall-score-info .score-change { justify-content: flex-start; }

  .profile-top { flex-direction: row; text-align: left; gap: 16px; }
  .profile-meta { justify-content: flex-start; }
  .last-measure { justify-content: flex-start; width: auto; }

  .hero-section { padding: 32px 28px; }
  .hero-greeting h1 { font-size: 1.5rem; }

  /* Modal - centered on tablet+ */
  .modal-overlay { align-items: center; padding: 20px; }
  .modal-content {
    max-width: 540px;
    border-radius: var(--radius-xl);
  }
  .modal-lg { max-width: 680px; }

  .form-grid { grid-template-columns: 1fr 1fr; gap: 0 20px; }

  .filter-bar { flex-direction: row; }
  .search-input-wrapper { min-width: 200px; flex: 1; }
  .filter-select { width: auto; min-width: 140px; }

  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
  .quick-action-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-action-btn { flex-direction: row; }

  .app-switcher { top: 76px; right: 32px; bottom: auto; }

  .toast { left: 50%; right: auto; transform: translateX(-50%); bottom: 40px; }
}

/* ---- Desktop (768px+) ---- */
@media (min-width: 768px) {
  .student-app { padding-bottom: 0; }
  .mobile-nav { display: none; }
  .mobile-top-header { display: none; }
  .pc-header { display: block; }
  .student-container { padding: 24px 32px; max-width: 1100px; }

  .hero-section { padding: 48px 40px; border-radius: var(--radius-xl); }
  .hero-greeting h1 { font-size: 1.8rem; }

  .card { padding: 24px; border-radius: var(--radius-lg); }

  .overall-score-content { gap: 40px; }
  .score-ring-container { width: 180px; height: 180px; }
  .big-score { font-size: 2.8rem; }

  .video-grid { grid-template-columns: repeat(3, 1fr); }

  .chart-wrapper { max-height: 300px; }

  /* Admin desktop */
  .admin-sidebar { transform: translateX(0); }
  .admin-mobile-header { display: none; }
  .admin-mobile-nav { display: none; }
  .admin-content { margin-left: 240px; padding: 28px 32px; }

  /* Desktop/Mobile visibility */
  .mobile-only { display: none !important; }
  .desktop-only { display: block !important; }

  /* Admin chat desktop */
  .admin-chat-layout { grid-template-columns: 320px 1fr; }
  .chat-window-panel { display: flex !important; position: static; }
  .chat-back-btn { display: none !important; }
  .chat-container { height: calc(100vh - 180px); }

  .admin-section-row { grid-template-columns: 1fr 1fr; }
  .growth-admin-layout { grid-template-columns: 340px 1fr; }
  .growth-admin-right { order: 0; }
}

/* ---- Large Desktop (1200px+) ---- */
@media (min-width: 1200px) {
  .admin-content { padding: 32px 40px; }
  .student-container { max-width: 1100px; }
}

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* iOS safe area padding */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: calc(env(safe-area-inset-bottom) + 6px);
  }
  .student-app {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
}

/* Prevent horizontal scroll globally - use clip to avoid blocking vertical scroll */
html { overflow-x: clip; }
body { overflow-x: clip; overflow-y: auto; max-width: 100vw; }

/* Smooth scroll for tab switches */
html { scroll-behavior: smooth; }

/* Better scrollbar for mobile */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* Active state for mobile taps */
@media (pointer: coarse) {
  .card:active { transform: scale(0.98); }
  .btn:active { transform: scale(0.96); }
  .mobile-nav-item:active { background: var(--gray-50); }
  .notice-card:active { transform: scale(0.98); }
  .video-card:active { transform: scale(0.98); }
  .quick-action-btn:active { transform: scale(0.96); }
}
