* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  margin-bottom: 24px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0;
  font-size: 3rem;
  color: #172b4d;
}

.subtitle {
  margin: 8px 0 0;
  font-size: 1.1rem;
  color: #4b5563;
}

.status-badge {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #174ea6;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  background: white;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-label {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 700;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #172b4d;
}

.stat-value.small {
  font-size: 1.2rem;
}

.calendar-card {
  background: white;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin-bottom: 22px;
}

.calendar-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.calendar-card h2 {
  margin: 0;
}

.calendar-subtitle {
  margin-top: 6px;
  color: #6b7280;
}

.calendar-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4b5563;
  font-size: 0.9rem;
  font-weight: 600;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.green {
  background: #dcfce7;
  border: 1px solid #86efac;
}

.legend-dot.yellow {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.legend-dot.red {
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 14px;
  gap: 12px;
}

.month-label {
  font-weight: 800;
  font-size: 1.1rem;
  color: #172b4d;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.9rem;
}

.weekday-row div {
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-day {
  min-height: 88px;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.calendar-day:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.calendar-day.empty {
  background: transparent;
  border: none;
  cursor: default;
  box-shadow: none;
}

.calendar-day.free {
  background: #ecfdf3;
}

.calendar-day.medium {
  background: #fffbeb;
}

.calendar-day.busy {
  background: #fef2f2;
}

.calendar-day.today {
  outline: 2px solid #1a73e8;
}

.day-number {
  font-weight: 800;
  color: #172b4d;
}

.day-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  background: white;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.full-width {
  grid-column: 1 / -1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.35rem;
}

label {
  display: block;
  margin-bottom: 8px;
  margin-top: 12px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  background: #1a73e8;
  color: white;
}

button.secondary {
  background: #e8f0fe;
  color: #174ea6;
}

button:hover {
  opacity: 0.94;
}

.helper {
  margin-top: 14px;
  color: #4b5563;
}

.empty-state {
  padding: 18px;
  border: 1px dashed #c7d2fe;
  border-radius: 14px;
  color: #6b7280;
  background: #fafbff;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  background: #fcfcfd;
}

.task-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.task-title {
  font-weight: 800;
}

.priority-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.priority-high {
  background: #fee2e2;
  color: #b91c1c;
}

.priority-medium {
  background: #fef3c7;
  color: #92400e;
}

.priority-low {
  background: #dcfce7;
  color: #166534;
}

.plan-box {
  background: #fafbff;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 18px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.meta-list {
  margin-top: 14px;
  padding-left: 18px;
}

.loading {
  color: #174ea6;
  font-weight: 700;
}

.error {
  color: #b91c1c;
  font-weight: 700;
}

.success {
  color: #166534;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 760px;
  max-height: 80vh;
  overflow-y: auto;
  background: white;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-header h3 {
  margin: 0;
}

.close-btn {
  background: #f3f4f6;
  color: #111827;
  font-size: 1.3rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  padding: 0;
}

.modal-body {
  margin-top: 18px;
}

.modal-task {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fafafa;
}

.no-task {
  color: #6b7280;
  font-weight: 700;
}

@media (max-width: 980px) {
  .stats-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .calendar-grid,
  .weekday-row {
    gap: 8px;
  }

  .calendar-day {
    min-height: 76px;
  }
}