* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: '맑은 고딕', sans-serif; background: #f4f6fb; color: #222; }
header { background: #252e4f; color: #fff; padding: 18px 32px; font-size: 20px; font-weight: bold; letter-spacing: 1px; }
.container { max-width: 1100px; margin: 28px auto; padding: 0 16px; }

.card { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px #0001; padding: 24px 28px; margin-bottom: 22px; }
.card h2 { font-size: 15px; color: #252e4f; margin-bottom: 16px; border-bottom: 2px solid #e8eaf0; padding-bottom: 8px; }

.form-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 13px; color: #555; font-weight: bold; }
.form-group input, .form-group select {
  border: 1px solid #ccd0dd; border-radius: 6px; padding: 7px 11px; font-size: 14px;
  font-family: inherit; outline: none; transition: border .2s;
}
.form-group input:focus, .form-group select:focus { border-color: #252e4f; }

.checkbox-group { display: flex; gap: 20px; align-items: center; }
.checkbox-group label { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; }

.btn { padding: 9px 28px; border: none; border-radius: 6px; font-size: 14px; font-family: inherit; cursor: pointer; font-weight: bold; transition: background .15s; }
.btn-primary { background: #252e4f; color: #fff; }
.btn-primary:hover { background: #3a4875; }
.btn-export { background: #2e7d32; color: #fff; }
.btn-export:hover { background: #388e3c; }
.btn-export:disabled { background: #aaa; cursor: not-allowed; }
.btn-viewer { background: #00838f; color: #fff; }
.btn-viewer:hover { background: #00acc1; }
.btn-viewer:disabled { background: #aaa; cursor: not-allowed; }
.btn-settings { background: #f0f2fa; color: #252e4f; border: 1px solid #ccd0dd; }
.btn-settings:hover { background: #e2e6f5; }

/* 탭 */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #e8eaf0; margin-bottom: 0; }
.tab-btn {
  padding: 9px 22px; border: none; background: none; font-size: 14px;
  font-family: inherit; cursor: pointer; color: #888; border-bottom: 3px solid transparent;
  margin-bottom: -2px; font-weight: bold; transition: color .15s, border-color .15s;
}
.tab-btn.active { color: #252e4f; border-bottom-color: #252e4f; }
.tab-content { display: none; padding-top: 18px; }
.tab-content.active { display: block; }

/* 테이블 */
table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
th { background: #252e4f; color: #fff; padding: 9px 12px; text-align: center; }
/* 열 너비 고정 (뱃지 유무와 무관하게 열이 고정됨) */
th:nth-child(1) { width: 100px; }  /* 신청일 */
th:nth-child(2) { width: 120px; }  /* 회차 */
th:nth-child(3) { width: 140px; }  /* 실업인정일 */
th:nth-child(4) { width: 160px; }  /* 구직활동기간 */
th:nth-child(5) { width: 100px; }  /* 지급일수 */
td { padding: 8px 12px; text-align: center; border-bottom: 1px solid #eee; overflow: hidden; }
tr:hover td { background: #f7f8fd; }
.customized td { background: #f0fdf4 !important; }
.customized td:nth-child(3) { color: #1a6e2e; font-weight: bold; }
tr.holiday-row td { background: #fff8e1 !important; }
tr.holiday-row td.app-date-cell { background: #fff !important; }
tr.holiday-row td:nth-child(3) { color: #e65100; font-weight: bold; }
.customized td.app-date-cell { background: #fff !important; }
.edit-btn {
  display: inline-block; margin-left: 6px; cursor: pointer;
  font-size: 12px; color: #aaa; vertical-align: middle;
  border: 1px solid #ddd; border-radius: 3px; padding: 1px 5px;
  background: #fafafa; transition: all .15s;
}
.edit-btn:hover { color: #252e4f; border-color: #252e4f; background: #f0f2fa; }
.holiday-badge {
  display: inline-block; font-size: 11px; background: #ff8f00;
  color: #fff; border-radius: 3px; padding: 1px 5px; margin-left: 4px; vertical-align: middle;
}
.over34-cell { color: #d32f2f !important; font-weight: bold; }
.over34-badge { display:inline-block; font-size:11px; background:#d32f2f; color:#fff; border-radius:3px; padding:1px 5px; margin-left:4px; vertical-align:middle; cursor:default; }
/* 센터출석 뱃지 */
.center-badge {
  display: inline-block; font-size: 10px; font-weight: bold;
  background: #c0392b; color: #fff; border-radius: 3px;
  padding: 1px 5px; vertical-align: middle;
  letter-spacing: 0;
}
/* 회차 칸: 뱃지 + 숫자를 왼쪽 정렬, 줄바꿈 없이 */
td.round-cell {
  text-align: left;
  white-space: nowrap;
  padding-left: 14px;
}
/* 실업인정일 칸: 공휴일 뱃지가 붙어도 줄바꿈 없이 */
td.recday-cell {
  white-space: nowrap;
}
/* 라벨 출력 버튼 */
.btn-label { background: #7b2d8b; color: #fff; }
.btn-label:hover { background: #9c3aab; }
.btn-label:disabled { background: #aaa; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.badge-general { background: #e8f0fe; color: #1a56db; }
.badge-recurrent { background: #fdf2f2; color: #c0392b; }
.badge-first { background: #e9fbe9; color: #2e7d32; }
.empty-msg { text-align: center; color: #aaa; padding: 36px 0; font-size: 15px; }

/* 로딩 */
#loading { display: none; text-align: center; padding: 30px; color: #555; font-size: 15px; }
.spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid #ddd; border-top-color: #252e4f; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 모달 */
.modal-overlay { display: none; position: fixed; inset: 0; background: #0005; z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 28px 32px; width: 540px; max-width: 95vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 32px #0003; }
.modal h3 { font-size: 16px; color: #252e4f; margin-bottom: 18px; }
.modal-section { margin-bottom: 18px; }
.modal-section h4 { font-size: 13px; color: #555; margin-bottom: 10px; background: #f4f6fb; padding: 5px 10px; border-radius: 4px; }
.setting-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.setting-row label { min-width: 180px; font-size: 13px; color: #444; }
.setting-row input { flex: 1; border: 1px solid #ccd0dd; border-radius: 5px; padding: 5px 9px; font-size: 13px; font-family: inherit; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.alert { padding: 10px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #fdf2f2; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #e9fbe9; color: #2e7d32; border: 1px solid #b2dfdb; }
.alert-warn { background: #fff8e1; color: #e65100; border: 1px solid #ffcc80; }

/* 편집 피커 */
#editPickerOverlay .modal { width: 310px; }
.edit-cal-info { font-size: 13px; color: #555; background: #f4f6fb; padding: 6px 10px; border-radius: 6px; }
.edit-cal-info:empty { display: none; margin-bottom: 0; }
.edit-cal-info:not(:empty) { margin-bottom: 10px; }

/* 날짜 피커 */
.datepicker-wrap { position: relative; flex: 1; }
.datepicker-chips {
  min-height: 40px; border: 1px solid #ccd0dd; border-radius: 6px;
  padding: 5px 8px; cursor: pointer; display: flex; flex-wrap: wrap;
  gap: 5px; align-items: center; background: #fff; transition: border .2s;
}
.datepicker-chips:focus-within, .datepicker-chips.open { border-color: #252e4f; }
.datepicker-chips .placeholder { color: #aaa; font-size: 14px; line-height: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #252e4f; color: #fff; border-radius: 14px;
  padding: 3px 10px 3px 12px; font-size: 13px;
}
.chip-remove { cursor: pointer; font-size: 15px; line-height: 1; opacity: .7; }
.chip-remove:hover { opacity: 1; }

.dp-popup {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: #fff; border: 1px solid #ccd0dd; border-radius: 10px;
  box-shadow: 0 8px 24px #0002; width: 280px; padding: 12px;
}
.dp-popup.open { display: block; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-nav button { background: none; border: none; font-size: 18px; cursor: pointer; color: #252e4f; padding: 2px 8px; border-radius: 4px; }
.dp-nav button:hover { background: #f0f2fa; }
.dp-month-label { font-size: 15px; font-weight: bold; color: #252e4f; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid .dp-head { text-align: center; font-size: 11px; font-weight: bold; color: #888; padding: 3px 0; }
.dp-grid .dp-head:first-child { color: #c0392b; }
.dp-grid .dp-head:last-child { color: #1a56db; }
.dp-day {
  text-align: center; padding: 5px 2px; font-size: 13px; border-radius: 50%;
  cursor: pointer; line-height: 26px; width: 30px; height: 30px; margin: auto;
}
.dp-day:hover { background: #e8f0fe; }
.dp-day.empty { cursor: default; }
.dp-day.empty:hover { background: none; }
.dp-day.sunday { color: #c0392b; }
.dp-day.saturday { color: #1a56db; }
.dp-day.holiday { color: #c0392b; font-weight: bold; }
.dp-day.selected { background: #252e4f !important; color: #fff !important; font-weight: bold; }
.dp-day.today-marker { outline: 2px solid #f39c12; outline-offset: -2px; border-radius: 50%; }

/* 달력 */
.cal-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.cal-month { border: 1px solid #e0e4ef; border-radius: 10px; overflow: hidden; min-width: 260px; flex: 1; }
.cal-month-title { background: #252e4f; color: #fff; text-align: center; padding: 8px 0; font-size: 14px; font-weight: bold; }
.cal-week-header { display: grid; grid-template-columns: repeat(7, 1fr); background: #f0f2fa; }
.cal-week-header span { text-align: center; font-size: 12px; font-weight: bold; padding: 5px 0; }
.cal-week-header span:first-child { color: #c0392b; }
.cal-week-header span:last-child { color: #1a56db; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day {
  min-height: 44px; padding: 4px 3px; font-size: 12px; text-align: center;
  position: relative; cursor: default; border-top: 1px solid #f0f2f8;
}
.cal-day.empty { background: #fafafa; }
.cal-day .day-num { display: inline-block; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; font-weight: bold; }
.cal-day.sunday .day-num { color: #c0392b; }
.cal-day.saturday .day-num { color: #1a56db; }
.cal-day.holiday .day-num { color: #c0392b; }
.cal-day.app-date .day-num { background: #252e4f; color: #fff !important; }
.cal-day .markers { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 2px; }
.cal-day .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-general { background: #1a56db; }
.dot-recurrent { background: #c0392b; }
.dot-first { background: #2e7d32; }
.cal-day.today .day-num { outline: 2px solid #f39c12; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #555; margin-top: 14px; }
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.legend-app { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: #252e4f; }
.holiday-name { font-size: 9px; color: #c0392b; line-height: 1.1; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 36px; }
