:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --danger: #dc2626;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 36px;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: #fff;
}
.topbar h1 { margin: 0 0 8px; }
.topbar p { margin: 0; opacity: 0.9; }
.user-area { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.layout { max-width: 1200px; margin: 24px auto; padding: 0 20px 40px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.toolbar { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.section-title h2 { margin: 0; }
.section-title span { color: var(--muted); }

label { display: grid; gap: 8px; font-weight: 700; color: #374151; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--primary-dark); }
button.secondary { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35); }
.card button.secondary { background: #eef2ff; color: #3730a3; border: 0; }
.text-button { padding: 0; background: transparent; color: var(--primary); }
.text-button:hover { background: transparent; color: var(--primary-dark); }
.text-button.danger { color: var(--danger); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.team-invite { color: var(--muted); font-weight: 700; padding: 12px 0; }

.month-picker { min-width: 180px; }
.calendar { display: grid; gap: 10px; }
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.calendar-weekdays span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}
.calendar-day {
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fbfdff;
  color: var(--text);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 6px;
}
.calendar-day:hover { background: #eef2ff; }
.calendar-day.muted { background: transparent; box-shadow: none; cursor: default; }
.calendar-date { font-weight: 900; color: var(--primary); }
.calendar-item {
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--primary);
  padding-left: 6px;
  font-size: 12px;
  line-height: 1.35;
}
.calendar-item span,
.calendar-empty,
.calendar-more { color: var(--muted); font-size: 12px; }

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.member-column {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fbfdff;
  min-height: 180px;
}
.member-column h3 { margin: 0 0 4px; }
.member-email { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.schedule-list { display: grid; gap: 10px; }
.schedule-card {
  border-left: 4px solid var(--primary);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.schedule-time { color: var(--primary); font-weight: 800; margin-bottom: 8px; }
.schedule-content { white-space: pre-wrap; line-height: 1.5; }
.schedule-actions { display: flex; gap: 12px; margin-top: 10px; }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.empty.small { text-align: left; padding: 8px 0; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
}
.auth-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.auth-card h1 { margin: 0 0 8px; }
.auth-card p { color: var(--muted); }
.auth-card form { display: grid; gap: 16px; margin-top: 24px; }
.switch-link { text-align: center; }
a { color: var(--primary); font-weight: 700; }
.error { color: var(--danger); min-height: 22px; }
.success { color: #16a34a; min-height: 22px; }

dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.dialog-form { padding: 24px; display: grid; gap: 16px; }
.dialog-form h2 { margin: 0; }
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; }
.dialog-actions .secondary { background: #f3f4f6; color: #374151; }

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 24px 20px; }
  .calendar-weekdays,
  .calendar-grid { grid-template-columns: 1fr; }
  .calendar-weekdays { display: none; }
  .calendar-day.muted { display: none; }
  .time-row { grid-template-columns: 1fr; }
}
