/* Daily Moment - 최종 CSS 파일 */

/* ==========================================================================
   1. Reset & Base Styles (초기화 및 기본 스타일)
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-900: #0c4a6e;
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-200: #bbf7d0;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
     2. Main App Layout (앱 전체 레이아웃)
     ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  background-color: var(--gray-50);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1001;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-600);
  text-decoration: none;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-main {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
}

.view {
  display: none;
}
.view.active {
  display: block;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================================================
     3. Common Components (공통 컴포넌트)
     ========================================================================== */
/* --- Buttons --- */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--primary-600);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-700);
}
.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
}
.btn-secondary:hover {
  background: var(--gray-300);
}
.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  background: var(--gray-200);
}

/* --- Navigation --- */
.nav-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border-bottom: 2px solid transparent;
}
.nav-btn:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
}
.nav-btn.active {
  color: var(--primary-600);
  font-weight: 600;
  border-bottom-color: var(--primary-600);
}

/* --- User Profile --- */
.user-profile-dropdown {
  position: relative;
}
.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  background-color: var(--gray-200);
  border: 1px solid var(--gray-300);
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-avatar.placeholder {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-700);
}
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 200px;
  z-index: 1002;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.user-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
}
.user-menu a:hover {
  background-color: var(--gray-100);
}
.user-menu .danger {
  color: var(--error-600);
}
.user-menu .danger:hover {
  background-color: var(--error-50);
}
.user-info {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

/* --- View Header (페이지 공통 헤더) --- */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.view-header h2 {
  font-size: 1.75rem;
  color: var(--gray-800);
  margin: 0;
}
.view-actions {
  display: flex;
  gap: 0.75rem;
}

/* --- Stat Cards --- */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  font-size: 1.75rem;
  width: 50px;
  height: 50px;
  background: var(--primary-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-content h3 {
  font-size: 1.75rem;
  font-weight: 700;
}
.stat-content h3 small {
  font-size: 0.7em;
  font-weight: 500;
  color: var(--gray-500);
  margin-left: 0.2em;
}
.stat-content p {
  color: var(--gray-600);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
}
.empty-state h3 {
  color: var(--gray-600);
}

/* ==========================================================================
     4. Page-Specific Styles (페이지별 스타일)
     ========================================================================== */

/* --- Dashboard Specific Styles --- */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.date-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.date-nav-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--gray-600);
  font-size: 1.2rem;
}
.date-nav-btn:hover {
  background: var(--primary-100);
  color: var(--primary-600);
  border-color: var(--primary-200);
}
.current-date h2 {
  font-size: 1.5rem;
}
.current-date p {
  color: var(--gray-600);
}

/* Goals Section */
.goals-section {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
}
.goals-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.goals-header h3 {
  font-size: 1.25rem;
}
.goals-body {
  padding: 1.5rem;
}

/* New Goal Input Row (1줄 레이아웃) */
.goal-input-row {
  display: grid;
  grid-template-columns: 2fr 3fr auto auto auto;
  gap: 1rem;
  align-items: end;
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-200);
}

.task-select {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: white;
  color: var(--gray-700);
  min-width: 200px;
}

.goal-name-input {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: white;
  color: var(--gray-700);
  min-width: 250px;
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.session-input {
  width: 60px;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  text-align: center;
  background: white;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.session-group {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: fit-content;
}

.session-group .session-input {
  border: none;
  padding: 0.5rem 0.25rem;
  width: 50px;
  background: transparent;
}

.session-group .session-input:focus {
  box-shadow: none;
}

.input-suffix {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
}

.session-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
}

.duration-select {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: white;
  color: var(--gray-700);
  min-width: 80px;
}

.add-goal-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--primary-600);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.add-goal-btn:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.add-goal-btn .btn-icon {
  font-size: 0.9rem;
}

.add-goal-btn .btn-text {
  font-size: 0.9rem;
}

/* 기존 add-goal-form 스타일 제거를 위한 오버라이드 */
.add-goal-form {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

/* Focus states */
.task-select:focus,
.goal-name-input:focus,
.session-input:focus,
.duration-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.session-group:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Goal Cards (새로운 목표 카드 디자인) */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goal-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.goal-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.goal-card.completed {
  background: linear-gradient(135deg, var(--success-50), var(--primary-50));
  border-color: var(--success-200);
}

.goal-card.completed::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--success-500), var(--primary-500));
}

/* Goal Info Section */
.goal-info {
  margin-bottom: 1rem;
}

.goal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.goal-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-800);
  margin: 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.parent-task-name {
  color: var(--gray-600);
  font-weight: 400;
  font-size: 0.9rem;
}

.title-divider {
  color: var(--gray-400);
  font-weight: 300;
  font-size: 0.8rem;
}

.daily-task-name {
  color: var(--gray-800);
  font-weight: 600;
  font-size: 1rem;
}

.goal-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.parent-task-badge {
  background: var(--primary-100);
  color: var(--primary-700);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--primary-200);
}

.completed-badge {
  background: var(--success-100);
  color: var(--success-700);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--success-200);
  white-space: nowrap;
}

/* Progress Section */
.goal-progress-section {
  margin-bottom: 1.25rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.progress-percentage {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-600);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.progress-bar {
  width: 100%;
  height: 100%;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-md);
  transition: width 0.3s ease;
  will-change: width;
}

.progress-bar.primary .progress-fill {
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
}

.progress-bar.warning .progress-fill {
  background: linear-gradient(90deg, var(--warning-500), var(--warning-400));
}

.progress-bar.success .progress-fill {
  background: linear-gradient(90deg, var(--success-500), var(--success-400));
}

/* Goal Actions Section */
.goal-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

/* Session Controls */
.session-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  padding: 0;
  border: none;
}

.session-controls.in-goal-card {
  background: var(--gray-50);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.session-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-btn.minus {
  background: var(--error-100);
  color: var(--error-600);
}

.session-btn.minus:hover:not(:disabled) {
  background: var(--error-500);
  color: white;
  transform: scale(1.1);
}

.session-btn.plus {
  background: var(--primary-100);
  color: var(--primary-600);
}

.session-btn.plus:hover {
  background: var(--primary-500);
  color: white;
  transform: scale(1.1);
}

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

.session-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--gray-700);
}

.session-count {
  color: var(--primary-600);
  font-size: 1.1rem;
}

.session-target {
  color: var(--gray-500);
}

.session-divider {
  color: var(--gray-400);
  margin: 0 0.25rem;
}

.session-unit {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-left: 0.25rem;
}

/* Goal Meta */
.goal-meta {
  display: flex;
  justify-content: center;
}

.time-spent {
  background: var(--warning-50);
  color: var(--warning-700);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--warning-200);
}

/* Activity Record Section */
.activity-record-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0;
}

.record-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.record-display:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.record-icon {
  font-size: 1.1rem;
}

.record-value {
  font-weight: 600;
  color: var(--primary-700);
}

.record-unit {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.record-placeholder {
  color: var(--gray-500);
  font-weight: 500;
}

/* Activity Record Modal */
.record-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  width: 90%;
  max-width: 320px;
  z-index: 1100;
}

.record-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
}

.record-modal h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--gray-800);
}

.record-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.record-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  text-align: center;
  font-weight: 600;
}

.record-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.unit-select {
  width: 100px;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.record-quick-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.quick-record-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-record-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.record-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Goal Buttons */
.goal-buttons {
  display: flex;
  gap: 0.5rem;
}

.achievement-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-btn.pending {
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
}

.achievement-btn.pending:hover {
  background: var(--success-100);
  border-color: var(--success-400);
  transform: scale(1.1);
}

.achievement-btn.achieved {
  background: var(--success-100);
  border: 2px solid var(--success-400);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.action-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.action-btn:hover {
  background: var(--gray-200);
  transform: scale(1.05);
}

.action-btn.edit:hover {
  background: var(--primary-100);
  color: var(--primary-600);
}

.action-btn.delete:hover {
  background: var(--error-100);
  color: var(--error-600);
}
.form-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr auto;
  gap: 1rem;
  align-items: flex-end;
}
.form-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
  display: block;
}
.form-row input,
.form-row select {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  width: 100%;
}
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px rgb(14 165 233 / 0.1);
}
.add-btn {
  background: var(--primary-500);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}
.add-btn:hover {
  background: var(--primary-600);
}
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.goal-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.3s ease;
}
.goal-item.completed {
  background: var(--success-50);
  border-left: 4px solid var(--success-500);
}

/* --- Tasks --- */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.task-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.task-info h4 {
  margin-bottom: 0.25rem;
}
.task-meta {
  color: var(--gray-600);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.task-actions {
  display: flex;
  gap: 0.5rem;
}
.goal-progress,
.task-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary-500);
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* --- Statistics --- */
.stats-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stats-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  min-width: 150px;
}
.stats-grid {
  display: grid;
  /* 1. 기본적으로(넓은 화면에서) 동일한 너비의 2개 열을 생성합니다. */
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.chart-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}
.chart-container h3 {
  margin-bottom: 1.5rem;
}
.chart-description {
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}
.heatmap-container {
  grid-column: 1 / -1;
}
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 4px;
}
.heatmap-cell {
  width: 15px;
  height: 15px;
  background-color: var(--gray-200);
  border-radius: 3px;
}
.heatmap-cell[data-level="1"] {
  background-color: #9be9a8;
}
.heatmap-cell[data-level="2"] {
  background-color: #40c463;
}
.heatmap-cell[data-level="3"] {
  background-color: #30a14e;
}
.heatmap-cell[data-level="4"] {
  background-color: #216e39;
}

/* 히트맵 범례 스타일 */
.heatmap-legend {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--gray-600);
}
.heatmap-legend div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.heatmap-legend small {
  font-size: 0.75rem;
}

/* style.css 파일에 추가하세요 */

.guide-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.guide-section {
  background-color: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.guide-section h2 {
  font-size: 1.5rem;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1rem;
}

.guide-section h3 {
  font-size: 1.2rem;
  color: var(--gray-700);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.guide-section p,
.guide-section li {
  color: var(--gray-600);
  line-height: 1.7;
}

.guide-section ul,
.guide-section ol {
  padding-left: 1.5rem;
}

.guide-section li {
  margin-bottom: 0.75rem;
}

.guide-section strong {
  color: var(--primary-700);
  font-weight: 600;
}

.example-box {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1rem 0;
}
.example-box h4 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--gray-800);
}
/* ==========================================================================
   Modal & Forms (모달 및 내부 폼 스타일)
   ========================================================================== */

/* --- Modal Shell (모달 기본틀) --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* --- Modal Structure (모달 내부 구조) --- */
.modal-content form {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-title {
  font-size: 1.25rem;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--gray-400);
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}
.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}

/* --- Form Layout & Base (폼 기본 레이아웃) --- */
.form-group {
  margin-bottom: 1.5rem;
}
.form-label,
.form-group legend {
  display: block;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px rgb(14 165 233 / 0.2);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* --- Custom Form Components (커스텀 폼 요소) --- */
.day-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.day-selector input[type="checkbox"] {
  display: none;
}
.day-selector label {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  user-select: none;
}
.day-selector input[type="checkbox"]:checked + label {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  font-weight: 600;
}

/* --- Smart Modal UI (스마트 모달 UI) --- */
.form-section {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.form-section-icon {
  font-size: 1.5rem;
}
.form-section-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gray-800);
}
#calculated-end-date-info {
  font-size: 0.9rem;
  color: var(--gray-600);
  background-color: var(--gray-100);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
#calculated-end-date-info strong {
  color: var(--primary-600);
  font-weight: 600;
}
.task-summary {
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  color: var(--primary-900);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  transition: all 0.3s ease;
}
.task-summary strong {
  font-weight: 600;
}

.day-selector-shortcuts {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.shortcut-btn {
  background-color: var(--gray-200);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: background-color 0.2s;
}
.shortcut-btn:hover {
  background-color: var(--gray-300);
}

.day-selector {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.day-selector label {
  flex: 1;
  text-align: center;
  border: none;
  padding: 0.6rem 0.2rem;
  margin: 0.1rem;
}
.day-selector input[type="checkbox"]:checked + label {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  transform: scale(1.05);
}

/* ==========================================================================
     5. Modal Styles (모달 스타일)
     ========================================================================== */

/* Modal Overlay */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

/* Modal Content */
.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: var(--gray-100);
  color: var(--gray-600);
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
  background-color: var(--gray-50);
}

/* Form Styles for Modal */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Day Selector */
.day-selector {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.day-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  background-color: white;
  border: 1px solid var(--gray-200);
}

.day-option:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-200);
}

.day-option input {
  display: none;
}

.day-option span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
}

.day-option input:checked + span {
  color: white;
}

.day-option:has(input:checked) {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* End Date Display */
.end-date-display {
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--primary-700);
}

.end-date-display strong {
  color: var(--primary-800);
  font-weight: 600;
}

.end-date-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.end-date-row .end-date-display {
  flex: 1;
  margin-bottom: 0;
}

.date-picker-btn {
  background: white;
  border: 1px solid var(--primary-300);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-picker-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.picker-icon {
  font-size: 1.1rem;
}

.end-date-picker.hidden {
  display: none;
}

.end-date-picker {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.end-date-picker:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.end-date-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.end-date-picker {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.end-date-picker:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Required Indicator */
.required-indicator {
  color: var(--error-500);
  font-weight: 600;
  margin-left: 0.25rem;
}

/* Field Error Messages */
.field-error {
  background-color: var(--error-50);
  border: 1px solid var(--error-200);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--error-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-error.hidden {
  display: none;
}

/* Day Selector Container */
.day-selector-container {
  width: 100%;
}

.day-selector-container.error .day-selector {
  border-color: var(--error-500);
  background-color: var(--error-50);
}

.day-selector-container.error .day-option {
  border-color: var(--error-300);
}

/* Task Summary */
.task-summary {
  background: linear-gradient(135deg, var(--primary-50), var(--success-50));
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}

.summary-content h4 {
  margin: 0 0 0.75rem 0;
  color: var(--primary-800);
  font-size: 1rem;
  font-weight: 600;
}

.summary-content p {
  margin: 0.5rem 0;
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.5;
}

.summary-content .total-highlight {
  background-color: var(--success-100);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  font-weight: 600;
  color: var(--success-800);
  text-align: center;
  margin-top: 0.75rem;
}

/* ==========================================================================
     5.5. Dashboard Styles (대시보드 스타일)
     ========================================================================== */

/* Dashboard Header - 모던한 날짜 선택기 */
.dashboard-header {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
}

.date-selector-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-2xl);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-lg);
  min-height: 100px;
  max-width: 800px;
  width: 100%;
}

.date-navigation {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
}

.date-nav-btn {
  background: white;
  border: 2px solid var(--primary-200);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-700);
}

.date-nav-btn:hover {
  background: var(--primary-600);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-600);
}

.date-nav-btn:active {
  transform: translateY(0);
}

.date-display {
  flex: 1;
  text-align: center;
  max-width: 300px;
  margin: 0 auto;
}

.date-main {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.date-text {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-800);
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
  letter-spacing: 0.5px;
}

.date-picker-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  /* 달력 버튼 클릭 시 임시로 보이게 될 위치 */
}

.datepicker-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  width: 1px;
  height: 1px;
}

/* Datepicker 팝업 위치 조정 */
.datepicker {
  position: absolute !important;
  z-index: 1050 !important;
}

/* 달력 버튼 근처에 datepicker 팝업 위치시키기 */
.date-quick-actions .datepicker {
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  margin-top: 0.5rem !important;
}

/* 모바일에서는 중앙 정렬 */
@media (max-width: 768px) {
  .date-quick-actions .datepicker {
    right: 50% !important;
    transform: translateX(50%) !important;
  }
}

.date-subtitle {
  font-size: 1.1rem;
  color: var(--primary-600);
  font-weight: 600;
}

.date-quick-actions {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.quick-btn {
  background: white;
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-xl);
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--primary-700);
  min-width: 100px;
  position: relative; /* 캘린더 위치 기준점 */
}

.quick-btn:hover {
  background: var(--primary-600);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-600);
}

.calendar-btn {
  background: linear-gradient(135deg, var(--warning-50), var(--warning-100));
  border-color: var(--warning-300);
  color: var(--warning-700);
}

.calendar-btn:hover {
  background: var(--warning-600);
  border-color: var(--warning-600);
  color: white;
}

.quick-icon {
  font-size: 1.2rem;
}

.quick-text {
  font-size: 1rem;
}

/* Stats Cards - 개선된 통계 카드 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, white, var(--gray-50));
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-300);
}

.stat-card:nth-child(1)::before {
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}

.stat-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--success-500), var(--success-600));
}

.stat-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--warning-500), var(--warning-600));
}

.stat-card:nth-child(4)::before {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.stat-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  color: var(--primary-700);
}

.stat-card:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, var(--success-100), var(--success-200));
  color: var(--success-700);
}

.stat-card:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, var(--warning-100), var(--warning-200));
  color: var(--warning-700);
}

.stat-card:nth-child(4) .stat-icon {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #7c3aed;
}

.stat-content {
  flex: 1;
}

.stat-content h3 {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0 0 0.25rem 0;
  background: linear-gradient(135deg, var(--gray-800), var(--gray-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.stat-content p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Goals Section */
.goals-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.goals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--gray-50), white);
  border-bottom: 1px solid var(--gray-200);
}

.goals-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
}

.goals-actions {
  display: flex;
  gap: 0.75rem;
}

.goals-body {
  padding: 2rem;
}

/* Add Goal Form */
.add-goal-form {
  background: linear-gradient(135deg, var(--gray-50), var(--primary-50));
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.goal-input-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr auto auto auto;
  gap: 1rem;
  align-items: end;
}

.task-select, .goal-name-input, .session-input, .duration-select {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.task-select:focus, .goal-name-input:focus, .session-input:focus, .duration-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.session-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  min-width: 120px;
}

.session-input {
  border: none;
  padding: 0.25rem;
  width: 60px;
  text-align: center;
  font-weight: 600;
}

.input-suffix {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.add-goal-btn {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700)) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.goals-body .add-goal-btn:hover,
.add-goal-form .add-goal-btn:hover,
button.add-goal-btn:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800)) !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-md) !important;
}

.goals-body .add-goal-btn:active,
.add-goal-form .add-goal-btn:active,
button.add-goal-btn:active {
  transform: translateY(0) !important;
  box-shadow: var(--shadow-sm) !important;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800)) !important;
  color: white !important;
}

.btn-icon {
  font-size: 1rem;
}

.btn-text {
  font-size: 0.9rem;
}

/* Goal Cards */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goal-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-500));
}

.goal-card.completed {
  background: linear-gradient(135deg, var(--success-50), white);
  border-color: var(--success-300);
}

.goal-card.completed::before {
  background: linear-gradient(90deg, var(--success-500), var(--success-600));
}

.goal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-300);
}

.goal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.goal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.parent-task-name {
  color: var(--gray-600);
  font-weight: 500;
}

.title-divider {
  color: var(--gray-400);
  font-weight: 400;
}

.daily-task-name {
  color: var(--primary-700);
  font-weight: 700;
}

.completed-badge {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Progress Section */
.goal-progress-section {
  margin-bottom: 1.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
}

.progress-percentage {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-700);
}

.progress-bar-container {
  background: var(--gray-200);
  border-radius: var(--radius-md);
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-md);
  transition: all 0.5s ease;
}

/* Goal Actions */
.goal-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
}

.session-btn {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s ease;
  color: var(--gray-700);
}

.session-btn:hover {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
  transform: scale(1.1);
}

.session-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.session-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--gray-800);
}

.session-count {
  font-size: 1.1rem;
  color: var(--primary-700);
}

.session-divider {
  color: var(--gray-400);
}

.session-target {
  color: var(--gray-600);
}

.session-unit {
  font-size: 0.9rem;
  color: var(--gray-500);
}

.goal-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.activity-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary-600);
  font-weight: 600;
}

.goal-buttons {
  display: flex;
  gap: 0.5rem;
}

.achievement-btn, .action-btn {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.achievement-btn.achieved {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: white;
  border-color: var(--success-600);
}

.achievement-btn:hover, .action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.action-btn.edit:hover {
  background: var(--warning-100);
  border-color: var(--warning-400);
}

.action-btn.delete:hover {
  background: var(--error-100);
  border-color: var(--error-400);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-500);
}

.empty-state h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

/* ==========================================================================
     7. Toast Notifications (토스트 알림)
     ========================================================================== */

.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-500);
  min-width: 300px;
  font-weight: 500;
  animation: slideInRight 0.3s ease-out;
  pointer-events: auto;
}

.toast.info {
  border-left-color: var(--primary-500);
  color: var(--primary-800);
  background: linear-gradient(135deg, var(--primary-50), white);
}

.toast.success {
  border-left-color: var(--success-500);
  color: var(--success-800);
  background: linear-gradient(135deg, var(--success-50), white);
}

.toast.warning {
  border-left-color: var(--warning-500);
  color: var(--warning-800);
  background: linear-gradient(135deg, var(--warning-50), white);
}

.toast.error {
  border-left-color: var(--error-500);
  color: var(--error-800);
  background: linear-gradient(135deg, var(--error-50), white);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }
  
  .toast {
    min-width: auto;
  }
}

/* ==========================================================================
     9. Button Overrides (버튼 오버라이드)
     ========================================================================== */

/* 추가 버튼 호버 효과 강제 적용 */
#add-goal-btn,
button#add-goal-btn,
.add-goal-btn,
button.add-goal-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border: none !important;
  opacity: 1 !important;
}

#add-goal-btn:hover,
button#add-goal-btn:hover,
.add-goal-btn:hover,
button.add-goal-btn:hover {
  background: linear-gradient(135deg, #0369a1, #1e3a8a) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
  opacity: 1 !important;
}

#add-goal-btn:active,
button#add-goal-btn:active,
.add-goal-btn:active,
button.add-goal-btn:active {
  background: linear-gradient(135deg, #0369a1, #1e3a8a) !important;
  color: #ffffff !important;
  transform: translateY(0) !important;
  opacity: 1 !important;
}

#add-goal-btn .btn-icon,
#add-goal-btn .btn-text,
button#add-goal-btn .btn-icon,
button#add-goal-btn .btn-text,
.add-goal-btn .btn-icon,
.add-goal-btn .btn-text,
button.add-goal-btn .btn-icon,
button.add-goal-btn .btn-text {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* ==========================================================================
     8. Responsive Design (모바일 대응)
     ========================================================================== */
@media (max-width: 900px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
  }
  .form-row > div {
    display: flex;
    flex-direction: column;
  }
  .add-btn {
    margin-top: 1rem;
    height: auto;
  }
  
  /* Dashboard Mobile Styles */
  .dashboard-header {
    margin-bottom: 2rem;
  }
  
  .date-selector-modern {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: auto;
    max-width: 100%;
  }
  
  .date-navigation {
    justify-content: center;
    gap: 1.5rem;
  }
  
  .date-nav-btn {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  
  .date-text {
    font-size: 1.5rem;
  }
  
  .date-subtitle {
    font-size: 1rem;
  }
  
  .date-quick-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .quick-btn {
    padding: 0.75rem 1rem;
    min-width: 80px;
  }
  
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
  }
  
  .stat-content h3 {
    font-size: 1.75rem;
  }
  
  .goals-body {
    padding: 1.5rem;
  }
  
  /* Goal Input Row - 모바일에서 2줄로 배치 */
  .goal-input-row {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, auto);
    gap: 0.75rem;
  }
  
  .session-group {
    min-width: auto;
    justify-content: center;
  }
  
  .goal-actions {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .session-controls {
    justify-content: center;
  }
  
  .goal-buttons {
    justify-content: center;
    gap: 1rem;
  }
  
  .task-select,
  .goal-name-input {
    min-width: auto;
    width: 100%;
  }
  
  .session-controls {
    justify-content: space-between;
    background: var(--gray-100);
    padding: 0.75rem;
    border-radius: var(--radius-md);
  }
  
  .duration-select {
    min-width: auto;
    width: 100%;
  }
  
  .add-goal-btn {
    justify-content: center;
    padding: 1rem;
  }
  
  /* Goal Cards - 모바일 반응형 */
  .goal-card {
    padding: 1rem;
  }
  
  .goal-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .session-controls.in-goal-card {
    justify-content: center;
    padding: 1rem;
  }
  
  .session-group {
    justify-content: center;
    padding: 0.75rem;
    min-width: auto;
    flex: 1;
  }
  
  .goal-meta {
    order: -1; /* 시간 정보를 맨 위로 */
  }
  
  .goal-buttons {
    justify-content: center;
    gap: 1rem;
  }
  
  .achievement-btn,
  .action-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  
  /* Modal responsive */
  .modal-content {
    max-width: 95vw;
    margin: 0.5rem;
  }
  
  .day-selector {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
  }
  
  .day-option {
    padding: 0.5rem 0.25rem;
  }
  
  .day-option span {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 1rem;
  }
  .logo {
    font-size: 1.25rem;
  }
  .app-header .app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    height: 60px;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    justify-content: space-around;
    gap: 0;
  }
  .app-nav .nav-btn {
    flex: 1;
    border-bottom: none;
    border-radius: 0;
    height: 100%;
  }
  .app-nav .nav-btn.active {
    background-color: var(--primary-50);
  }
  .user-profile-dropdown {
    display: none;
  } /* 모바일 하단바에서는 프로필 숨김 */
  .app-main {
    padding: 1.5rem 1rem 70px 1rem;
  }
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  /* Dashboard Mobile Specific */
  .dashboard-header {
    margin-bottom: 1.5rem;
  }
  
  .date-selector-modern {
    padding: 1rem;
    gap: 1rem;
  }
  
  .date-navigation {
    gap: 1rem;
  }
  
  .date-nav-btn {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
  
  .date-text {
    font-size: 1.25rem;
  }
  
  .date-subtitle {
    font-size: 0.9rem;
  }
  
  .quick-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: 70px;
  }
  
  .quick-icon {
    font-size: 1rem;
  }
  
  .stats-cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .stat-icon {
    font-size: 1.75rem;
    width: 45px;
    height: 45px;
  }
  
  .stat-content h3 {
    font-size: 1.5rem;
  }
  
  .stat-content p {
    font-size: 0.85rem;
  }
  
  .goals-header {
    padding: 1rem 1.5rem;
  }
  
  .goals-body {
    padding: 1rem;
  }
  
  .add-goal-form {
    padding: 1rem;
  }
  
  .goal-card {
    padding: 1rem;
  }
  
  .session-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  
  .achievement-btn, .action-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  /* Modal mobile styles */
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 2rem;
  }
  
  .modal-content {
    max-width: 100%;
    max-height: calc(100vh - 3rem);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Enhanced Task List Styles (중장기 목표 리스트 개선된 스타일)
   ========================================================================== */
.task-item {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-500);
}

.task-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.task-item.active {
  border-left-color: var(--success-500);
}

.task-item.upcoming {
  border-left-color: var(--warning-500);
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.task-item.overdue {
  border-left-color: var(--error-500);
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

/* 완료된 중장기 목표 스타일 */
.task-item.completed {
  border-left-color: var(--success-500);
  background: linear-gradient(135deg, var(--success-50), var(--primary-50));
}

/* 보류 상태 목표 스타일 */
.task-item.on-hold {
  border-left-color: var(--warning-500);
  background: linear-gradient(135deg, var(--warning-50), var(--primary-50));
}

.task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.5rem 0;
}

.task-status-badge {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.status-text {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-700);
}

.task-item.active .status-text {
  background: var(--success-100);
  color: var(--success-700);
}

.task-item.upcoming .status-text {
  background: var(--warning-100);
  color: var(--warning-700);
}

.task-item.overdue .status-text {
  background: var(--error-100);
  color: var(--error-700);
}

.d-day {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--primary-100);
  color: var(--primary-700);
  font-family: 'Courier New', monospace;
}

.d-day.urgent {
  background: var(--error-500);
  color: white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

.task-main-content {
  padding: 1rem 1.5rem;
}

.task-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.task-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.meta-icon {
  font-size: 1.25rem;
  width: 2rem;
  text-align: center;
}

.meta-content {
  flex: 1;
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.125rem;
}

.meta-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
}

.task-progress-section {
  padding: 1rem 1.5rem 1.5rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

.progress-stats {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
}

.progress-bar-container {
  position: relative;
}

.progress-bar {
  width: 100%;
  height: 2rem;
  background: var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-600) 100%);
  border-radius: var(--radius-xl);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-fill.very-low {
  background: linear-gradient(90deg, var(--error-500) 0%, var(--error-600) 100%);
}

.progress-fill.low {
  background: linear-gradient(90deg, var(--warning-500) 0%, var(--warning-600) 100%);
}

.progress-fill.medium {
  background: linear-gradient(90deg, var(--warning-500) 0%, var(--primary-500) 100%);
}

.progress-fill.high {
  background: linear-gradient(90deg, var(--primary-500) 0%, var(--success-500) 100%);
}

.progress-fill.complete {
  background: linear-gradient(90deg, var(--success-500) 0%, var(--success-600) 100%);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Mobile optimization for activity record */
@media (max-width: 768px) {
  .activity-record-section {
    padding: 0.5rem 0;
  }
  
  .record-display {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
  }
  
  .record-modal {
    width: 95%;
    padding: 1.25rem;
  }
  
  .goal-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Mobile optimizations for enhanced task list */
@media (max-width: 768px) {
  .task-item {
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
  }
  
  .task-item-header {
    padding: 0.75rem 1rem 0;
  }
  
  .task-main-content {
    padding: 0.75rem 1rem;
  }
  
  .task-title {
    font-size: 1.125rem;
  }
  
  .task-meta-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .meta-item {
    padding: 0.5rem;
  }
  
  .task-progress-section {
    padding: 0.75rem 1rem 1rem;
  }
  
  .progress-bar {
    height: 1.5rem;
  }
  
  .progress-text {
    font-size: 0.75rem;
  }
  
  .task-status-badge {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Enhanced End Date Picker Styles (마감일 선택기 스타일)
   ========================================================================== */
.end-date-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.end-date-row:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.end-date-display {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.end-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
}

.date-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.date-picker-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: scale(1.05);
}

.date-picker-btn:active {
  transform: scale(0.95);
}

.picker-icon {
  transition: transform 0.2s ease;
}

.date-picker-btn:hover .picker-icon {
  transform: scale(1.1);
}

.end-date-picker {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: white;
  border: 2px solid var(--primary-300) !important;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 180px;
  transition: all 0.2s ease;
  display: block !important;
}

.end-date-picker.hidden {
  display: none !important;
}

.end-date-picker:not(.hidden) {
  display: block !important;
}

/* 디버깅을 위한 강제 스타일 */
.date-picker-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.shortcut-btn {
  display: inline-block !important;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.day-selector-shortcuts {
  display: flex !important;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.day-selector-container {
  margin-top: 0.5rem;
}

.day-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-option {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 3rem;
  justify-content: center;
}

.day-option:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.day-option input[type="checkbox"] {
  display: none;
}

.day-option input[type="checkbox"]:checked + span,
.day-option:has(input[type="checkbox"]:checked) {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-600);
}

.day-option:has(input[type="checkbox"]:checked) {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-600);
}

/* 마감일 직접 설정 시 시각적 피드백 */
.end-date-display.custom-set {
  color: var(--primary-600);
  font-weight: 600;
}

.end-date-display.custom-set::before {
  content: '📅 ';
  margin-right: 0.25rem;
}

/* Mobile 최적화 */
@media (max-width: 768px) {
  .end-date-row {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .date-picker-btn {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }
  
  .end-date-picker {
    right: -0.5rem;
    left: -0.5rem;
    min-width: auto;
  }
}

/* ==========================================================================
   Day Selection Shortcuts Styles (실행 요일 선택 버튼 스타일)
   ========================================================================== */
.day-selector-shortcuts {
  display: flex !important;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.shortcut-btn {
  display: inline-block !important;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--gray-100) !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius-md);
  color: var(--gray-700) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.shortcut-btn:hover {
  background: var(--primary-50) !important;
  border-color: var(--primary-300) !important;
  color: var(--primary-700) !important;
  transform: translateY(-1px);
}

.shortcut-btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 마감일 직접 설정 시 시각적 피드백 */
.end-date-display.custom-set {
  color: var(--primary-600);
  font-weight: 600;
}

.day-selector-container.error {
  border-color: var(--error-500) !important;
  background: var(--error-50) !important;
}

.field-error {
  color: var(--error-600);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--error-50);
  border: 1px solid var(--error-200);
  border-radius: var(--radius-md);
}

/* Task Summary Enhancement */
.task-summary {
  margin-top: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--success-50) 100%);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
}

.summary-content h4 {
  color: var(--primary-700);
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.summary-content p {
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.summary-content .total-highlight {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success-700);
  background: white;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 0.75rem;
  border: 1px solid var(--success-200);
}

/* ==========================================================================
   Group Detail View Styles (그룹 상세 뷰 스타일)
   ========================================================================== */
.group-detail-content {
  padding: 0;
  max-width: 100%;
  margin: 0;
}

.group-detail-content .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.group-detail-content .view-header h2 {
  margin: 0;
  color: var(--primary-700);
  flex: 1;
  text-align: center;
}

.header-left, .header-right {
  min-width: 120px;
}

.header-right {
  text-align: right;
}

.owner-badge {
  background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.group-info-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item strong {
  min-width: 120px;
  color: var(--gray-700);
  font-weight: 600;
}

.invite-code {
  background: var(--primary-50);
  color: var(--primary-700);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid var(--primary-200);
}

.invite-link-display {
  background: var(--success-50);
  color: var(--success-700);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--success-200);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.copy-code-btn {
  background: var(--success-500);
  color: white;
  border: 1px solid var(--success-600);
  transition: all 0.2s ease;
}

.copy-code-btn:hover {
  background: var(--success-600);
  transform: translateY(-1px);
}

.group-stats-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.group-stats-section h3 {
  margin: 0;
  color: var(--primary-700);
  font-size: 1.25rem;
}

.stats-placeholder {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
  font-style: italic;
}

/* Group Stats Styles (그룹 통계 스타일) */
.stats-overview {
  margin-bottom: 2rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.summary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.summary-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  border-radius: var(--radius-xl);
  border: 2px solid var(--primary-200);
}

.summary-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-700);
  margin: 0;
}

.stats-table {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.stats-table h4 {
  margin: 0 0 1.5rem 0;
  color: var(--primary-700);
  font-size: 1.25rem;
}

.ranking-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.ranking-row:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.ranking-row.current-user {
  background: linear-gradient(135deg, var(--success-50), var(--primary-50));
  border-color: var(--primary-400);
  box-shadow: var(--shadow-sm);
}

.ranking-row.current-user:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
}

/* ===== 추가: 그룹 통계 랭킹 및 상세 표 스타일 ===== */
/* 랭킹 토글 영역 */
.group-ranking-section {
  margin-top: 1.5rem;
}

/* 차트 캔버스: 최대 높이를 제한하여 화면을 넘치지 않도록 함 */
.group-ranking-section canvas {
  width: 100%;
  max-height: 600px;
  display: block;
}
.ranking-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.rank-toggle-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-lg);
  background-color: transparent;
  color: var(--gray-700);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-bottom: 3px solid transparent;
}
.rank-toggle-btn:hover {
  color: var(--primary-500);
}
.rank-toggle-btn.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-500);
}

/* 상세 통계 테이블 */
.stats-table.large {
  margin-top: 1.5rem;
  overflow-x: auto;
}
.stats-table.large table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.stats-table.large th,
.stats-table.large td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.875rem;
  border-right: 1px solid var(--gray-200);
}

/* 마지막 열 우측 경계 제거 */
.stats-table.large th:last-child,
.stats-table.large td:last-child {
  border-right: none;
}
.stats-table.large th {
  background-color: var(--gray-100);
  color: var(--gray-800);
  font-weight: 600;
}
.stats-table.large tbody tr:nth-child(odd) {
  background-color: var(--gray-50);
}
.stats-table.large tbody tr.current-user {
  background-color: var(--success-50);
}

.rank {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.member-stats {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 150px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-500), var(--primary-500));
  border-radius: var(--radius-lg);
  transition: width 0.8s ease;
}

.progress-text {
  font-weight: 600;
  color: var(--primary-700);
  font-size: 0.875rem;
  min-width: 40px;
  text-align: right;
}

.stats-empty, .stats-error {
  text-align: center;
  padding: 3rem;
  color: var(--gray-500);
}

.empty-icon, .error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.stats-empty h4, .stats-error h4 {
  margin: 0 0 0.5rem 0;
  color: var(--gray-700);
}

.stats-notice {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--warning-50);
  border: 1px solid var(--warning-200);
  border-radius: var(--radius-lg);
  text-align: center;
}

.stats-notice p {
  margin: 0;
  color: var(--warning-700);
  font-weight: 500;
}

.reload-stats-btn {
  margin-top: 1rem;
  background: var(--primary-500);
  color: white;
  border: none;
}

.reload-stats-btn:hover {
  background: var(--primary-600);
}

/* === Landing page styles === */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 2rem;
  text-align: center;
  /* 배경 이미지 및 스타일 */
  /* Replace default landing background with a calm gradient.  */
  background-image: url('../images/landing-bg2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--gray-1000);
}

.landing-hero {
  max-width: 720px;
  background-color: rgba(255, 255, 255, 0.85);
  padding: 2.5rem 3rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-700);
  margin-bottom: 1.5rem;
}

.landing-tagline {
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--gray-700);
  margin-bottom: 1rem;
}

.landing-subtagline {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 1.25rem;
}

/* Emphasis tagline for call-to-action */
.landing-subtagline.emphasis {
  font-weight: 600;
  color: var(--primary-600);
  margin-bottom: 2rem;
}

/* 그룹 정보와 액션 버튼을 포함하는 라인 */
.info-item-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.info-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.info-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* 소형 액션 버튼 스타일 */
.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  min-width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 위험 버튼 (삭제) */
.btn-small.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-small.btn-danger:hover:not(:disabled) {
  background-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* 경고 버튼 (탈퇴) */
.btn-small.btn-warning {
  background-color: #d97706;
  color: white;
}

.btn-small.btn-warning:hover:not(:disabled) {
  background-color: #b45309;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

/* 비활성 버튼 */
.btn-small.btn-disabled {
  background-color: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-small.btn-disabled:hover {
  background-color: var(--gray-300);
  transform: none;
  box-shadow: none;
}

/* 에러 메시지 */
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .info-item-with-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .info-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* 그룹 활동 섹션 스타일 */
.group-activity-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.activity-header h3 {
  margin: 0;
  color: var(--gray-800);
  font-size: 1.1rem;
  font-weight: 600;
}

/* 격려 입력 섹션 */
.activity-input-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
}

.activity-input-section.hidden {
  display: none;
}

.encouragement-input {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.encouragement-input input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.encouragement-input input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quick-reactions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.quick-reaction-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.quick-reaction-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-reaction-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

/* 활동 피드 */
.activities-feed {
  max-height: 400px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: white;
}

.activities-list {
  padding: 0.5rem;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: background-color 0.2s ease;
}

.activity-item:hover {
  background: var(--gray-50);
}

.activity-item.own-activity {
  background: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--primary-500);
}

.activity-icon {
  font-size: 1.25rem;
  min-width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-message {
  font-size: 0.9rem;
  color: var(--gray-800);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.activity-reactions {
  display: flex;
  gap: 0.25rem;
}

.reaction-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.reaction-btn:hover {
  background: var(--gray-100);
  opacity: 1;
  transform: scale(1.1);
}

/* 빈 상태와 오류 상태 */
.activities-empty,
.activities-error,
.activities-loading {
  text-align: center;
  padding: 2rem;
  color: var(--gray-600);
}

.empty-icon,
.error-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.activities-empty h4,
.activities-error h4 {
  margin: 0 0 0.5rem 0;
  color: var(--gray-700);
}

.activities-empty p,
.activities-error p {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
}

/* 이모지 반응 및 댓글 스타일 */
.activity-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reaction-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.reaction-btn:hover {
  background-color: var(--gray-100);
  transform: translateY(-1px);
}

.reaction-btn.reacted {
  background-color: var(--primary-100);
  border-color: var(--primary-500);
}

.reaction-count {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
}

.comment-toggle-btn {
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.comment-toggle-btn:hover {
  background-color: var(--gray-100);
  color: var(--gray-800);
}

.comments-list {
  margin-top: 0.75rem;
  padding-left: 3rem;
  border-left: 2px solid var(--gray-200);
}

.comment-item {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.comment-item strong {
  color: var(--gray-800);
  font-weight: 600;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-left: 0.5rem;
}

.comment-input-section {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background-color: var(--gray-50);
  border-radius: 8px;
  display: flex;
  gap: 0.5rem;
}

.comment-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 0.875rem;
}

.comment-submit-btn {
  padding: 0.5rem 1rem;
  background-color: var(--primary-600);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.comment-submit-btn:hover:not(:disabled) {
  background-color: var(--primary-700);
}

.comment-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 주간 요약 스타일 */
.group-weekly-summary-section {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.weekly-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.weekly-summary-header h3 {
  margin: 0;
  color: var(--gray-800);
}

/* 주간 업데이트 정보 */
.weekly-update-info {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--gray-100);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--gray-600);
}

.update-icon {
  font-size: 0.875rem;
}

.update-text {
  font-weight: 500;
}

.week-period {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.last-update-time {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.last-update-time.pending {
  color: var(--warning-600);
  background: var(--warning-50);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  display: inline-block;
  font-weight: 500;
}

.week-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.highlight-card {
  background-color: var(--gray-50);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  transition: transform 0.2s;
}

.highlight-card:hover {
  transform: translateY(-2px);
}

.highlight-card.mvp {
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
}

.highlight-card.sessions {
  background: linear-gradient(135deg, #fee2e2, #f87171);
}

.highlight-card.achievement {
  background: linear-gradient(135deg, #dbeafe, #60a5fa);
}

.highlight-card.time {
  background: linear-gradient(135deg, #e0e7ff, #818cf8);
}

.highlight-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.highlight-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.highlight-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.highlight-detail {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin: 0;
}

/* MVP 기준 표시 스타일 */
.mvp-criteria {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.criteria-icon {
  font-size: 0.875rem;
  opacity: 0.8;
}

.criteria-text {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 500;
  line-height: 1.2;
}

.highlight-detail.trend.positive {
  color: var(--success-600);
}

.highlight-detail.trend.negative {
  color: var(--danger-600);
}

.week-leaderboard {
  margin-bottom: 1rem;
}

.week-leaderboard h4 {
  margin: 0 0 0.75rem 0;
  color: var(--gray-800);
}

.leaderboard-list {
  background-color: var(--gray-50);
  border-radius: 8px;
  padding: 0.75rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.leaderboard-item:hover {
  background-color: var(--gray-100);
}

.leaderboard-item .rank {
  font-size: 1.25rem;
  width: 2rem;
}

.leaderboard-item .name {
  flex: 1;
  font-weight: 500;
  color: var(--gray-800);
}

.leaderboard-item .score {
  font-weight: 600;
  color: var(--primary-600);
}

.week-special-mention {
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: var(--primary-800);
}

.week-special-mention p {
  margin: 0;
}

.weekly-summary-empty,
.weekly-summary-error {
  text-align: center;
  padding: 2rem;
  color: var(--gray-600);
}

.update-schedule {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .activity-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .encouragement-input {
    flex-direction: column;
  }
  
  .quick-reactions {
    justify-content: center;
  }
  
  .activity-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .activity-reactions {
    align-self: flex-end;
  }
  
  .week-highlights {
    grid-template-columns: 1fr;
  }
  
  .activity-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .comment-input-section {
    flex-direction: column;
  }
}

/* 세션별 기록 모달 스타일 */
.record-modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.record-modal h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--gray-900);
}

.record-subtitle {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.record-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.record-input {
  flex: 1;
  padding: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.record-input:focus {
  border-color: var(--primary-500);
  outline: none;
}

.unit-select {
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
}

.record-quick-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.quick-record-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.quick-record-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

/* 전체 기록 보기 모달 */
.records-list-modal {
  max-width: 550px;
}

.total-record-summary {
  background: var(--primary-50);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-label {
  font-weight: 500;
  color: var(--gray-700);
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-700);
}

.session-records-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.session-record-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  background: var(--gray-50);
}

.session-label {
  font-weight: 500;
  color: var(--gray-700);
  min-width: 70px;
}

.record-value-group {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.record-edit-value {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
}

.unit-edit-select {
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: white;
}

.record-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.record-delete-btn:hover {
  opacity: 1;
}

.no-records {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
}

/* 기록 표시 수정 */
.record-display {
  cursor: pointer;
  padding: 0.375rem 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.record-display:hover {
  background: var(--primary-100);
  color: var(--primary-700);
}

.record-icon {
  font-size: 1rem;
}

.record-value {
  font-weight: 600;
}

.record-count {
  color: var(--gray-500);
  font-size: 0.75rem;
}

.record-placeholder {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* 저장 버튼 활성화 스타일 */
.btn.has-changes {
  background: var(--primary-600);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* 세션 컨트롤 수정 */
.activity-record-section {
  margin: 0 0.5rem;
}

/* 버튼 스타일 */
.btn-primary {
  padding: 0.625rem 1.25rem;
  background: var(--primary-600);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* 탭 스타일 */
.tasks-header {
  margin-bottom: 2rem;
}

.tasks-header h2 {
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--gray-900);
}

.tab-btn.active {
  color: var(--primary-600);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-600);
}

.tasks-controls {
  margin-bottom: 1.5rem;
}

/* 그룹 활동 상세 정보 스타일 */
.activity-detail {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-left: 0.5rem;
  font-style: italic;
}

.activity-message strong {
  color: var(--primary-600);
  font-weight: 600;
}

/* ========= 도서 검색 관련 스타일 ========= */
.book-search-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.book-search-container input {
  flex: 1;
}

.book-search-container button {
  white-space: nowrap;
}

.book-search-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.book-result-item {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s;
}

.book-result-item:hover {
  background-color: #e5e7eb;
}

.book-result-item:last-child {
  border-bottom: none;
}

.book-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.book-author {
  font-size: 14px;
  color: #6b7280;
}

.book-search-results .loading,
.book-search-results .no-results {
  padding: 20px;
  text-align: center;
  color: #6b7280;
}

/* 네이버 API 도서 검색 결과 스타일 */
.book-result-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.book-thumbnail {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

/* 도서 검색 결과 내 책 제목 스타일 */
.book-search-results .book-title {
  font-weight: 600;
  color: #111827 !important;
  margin-bottom: 4px;
  text-align: left;
  font-size: 14px;
}

/* 도서 검색 결과 내 출판사 스타일 */
.book-search-results .book-publisher {
  font-size: 13px;
  color: #6b7280 !important;
  text-align: left;
}

.book-publisher {
  font-size: 13px;
  color: #9ca3af;
}

/* ========= 독서 목표 책장 UI 스타일 ========= */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.book-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.book-cover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 1.5rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.book-cover[style*="background-image"] {
  padding: 0;
}

.book-cover[style*="background-image"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.book-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem;
  z-index: 1;
  text-align: center;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.book-author {
  font-size: 0.875rem;
  opacity: 0.9;
}

.book-progress {
  padding: 1rem 1.5rem;
  background: #f9fafb;
}

.book-progress .progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.book-progress .progress-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
}

.book-progress .progress-text {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

.book-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
}

.book-actions .btn-icon {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.book-actions .btn-icon:hover {
  background-color: #f3f4f6;
}

@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .book-cover {
    padding: 1.5rem 1rem;
    min-height: 120px;
  }
  
  .book-title {
    font-size: 1rem;
  }
}

/* ===== 중장기 목표 상태 버튼 ===== */
.task-status-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.status-btn {
  appearance: none;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.status-btn:hover {
  background: var(--gray-100);
}
.status-btn.active {
  border-color: var(--primary-600);
  background: var(--primary-50);
  color: var(--primary-700);
}

/* 책 상태 오버레이 */
.book-status-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 1rem;
  z-index: 2;
  pointer-events: none;
}
.book-spine.on-hold {
  opacity: 0.9;
  transform: rotate(180deg);
}
