* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1f2328;
}
header.topbar {
  background: #1e3a5f;
  color: #fff;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.topbar .brand { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 0.6rem; }
header.topbar nav a {
  color: #cfe0f2;
  text-decoration: none;
  margin-right: 1.2rem;
  font-size: 0.95rem;
}
header.topbar nav a:hover { color: #fff; }
header.topbar .user-box { font-size: 0.85rem; color: #cfe0f2; display: flex; align-items: center; gap: 0.8rem; }
header.topbar form { display: inline; }
header.topbar button.logout {
  background: none; border: 1px solid #4a6c8c; color: #cfe0f2; border-radius: 4px;
  padding: 0.25rem 0.6rem; cursor: pointer; font-size: 0.8rem;
}
main { max-width: 1000px; margin: 1.5rem auto; padding: 0 1.2rem; }
h1 { font-size: 1.4rem; margin-bottom: 1rem; }
h2 { font-size: 1.1rem; margin-top: 1.6rem; }
.card {
  background: #fff; border: 1px solid #e2e5ea; border-radius: 8px;
  padding: 1.2rem; margin-bottom: 1rem;
}
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
table th, table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid #eceef1; text-align: left; font-size: 0.92rem; }
table th { background: #f0f2f5; font-weight: 600; color: #444; }
table tr:hover td { background: #fafbfc; }
a.btn, button.btn {
  display: inline-block; background: #2b6cb0; color: #fff; border: none;
  padding: 0.5rem 0.9rem; border-radius: 6px; text-decoration: none; font-size: 0.9rem; cursor: pointer;
}
a.btn.secondary, button.btn.secondary { background: #e2e5ea; color: #333; }
a.btn.danger, button.btn.danger { background: #c0392b; }
.actions { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
form.stack label { display: block; font-size: 0.85rem; color: #555; margin: 0.7rem 0 0.25rem; }
form.stack input, form.stack select, form.stack textarea {
  width: 100%; padding: 0.5rem 0.6rem; border: 1px solid #d3d7dd; border-radius: 6px; font-size: 0.95rem;
  font-family: inherit;
}
form.stack .row { display: flex; gap: 1rem; }
form.stack .row > div { flex: 1; }
.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}
.badge.ok { background: #e3f6e8; color: #1c7c3c; }
.badge.warn { background: #fdeeda; color: #b5610a; }
.badge.danger { background: #fbe4e1; color: #b8291d; }
.badge.neutral { background: #eceef1; color: #555; }
.empty { color: #888; padding: 1rem 0; }
.login-wrap { max-width: 340px; margin: 8rem auto; }
.error { color: #c0392b; font-size: 0.9rem; margin-top: 0.5rem; }
.ok-msg { color: #1c7c3c; font-size: 0.9rem; margin-top: 0.5rem; }
.muted { color: #888; font-size: 0.85rem; }

/* 일정 캘린더 */
.calendar-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 0.6rem; }
.calendar-nav h1 { margin: 0; }
table.calendar-table { table-layout: fixed; }
table.calendar-table th { text-align: center; }
table.calendar-table td { vertical-align: top; height: 92px; padding: 0.35rem; }
table.calendar-table td.other-month { background: #fafbfc; }
table.calendar-table td.other-month .calendar-day-num { color: #c2c6cc; }
table.calendar-table td.today { background: #eaf2fb; }
.calendar-day-num { font-weight: 600; font-size: 0.85rem; }
.calendar-day-num a { color: inherit; text-decoration: none; }
.calendar-day-num a:hover { text-decoration: underline; }
.calendar-event {
  display: block; background: transparent; color: #2b6cb0; font-weight: 600; border-radius: 4px; padding: 0.1rem 0.35rem;
  font-size: 0.72rem; margin-top: 0.2rem; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-decoration: none;
}
.calendar-more { font-size: 0.72rem; color: #888; margin-top: 0.15rem; }

/* 일정 색상 선택기 (선택기 자체만 원 안에 색을 채우고, 실제 일정 표시는 글자색에만 적용합니다) */
.color-picker { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0.3rem 0; }
.color-swatch {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid #d7dadf;
  cursor: pointer; display: inline-block; position: relative;
}
.color-swatch input[type="radio"] {
  position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.color-swatch.selected {
  border-color: #1e3a5f; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1e3a5f;
}
