* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2328;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  background: #1f2937;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar .brand { font-weight: 700; font-size: 16px; color: #fff; }
.navbar nav a { color: #d1d5db; margin-right: 16px; font-size: 14px; }
.navbar nav a:hover { color: #fff; text-decoration: none; }
.navbar .user-info { font-size: 13px; color: #9ca3af; }
.navbar form { display: inline; }
.navbar button.link-btn {
  background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 13px; padding: 0;
}

.container { max-width: 1080px; margin: 24px auto; padding: 0 16px; }

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  overflow-x: auto;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; white-space: nowrap; }
th { color: #6b7280; font-weight: 600; font-size: 13px; }
tr:hover { background: #fafafa; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.badge-admin { background: #fee2e2; color: #b91c1c; }
.badge-user { background: #e0e7ff; color: #3730a3; }
.badge-status-진행중 { background: #dbeafe; color: #1e40af; }
.badge-status-예정 { background: #fef3c7; color: #92400e; }
.badge-status-완료 { background: #dcfce7; color: #166534; }
.badge-status-지연 { background: #fee2e2; color: #b91c1c; }
.badge-status-보류 { background: #f3f4f6; color: #374151; }
.badge-status-열림 { background: #fef3c7; color: #92400e; }
.badge-status-해결됨 { background: #dcfce7; color: #166534; }
.badge-status-종료 { background: #f3f4f6; color: #374151; }
.badge-priority-긴급 { background: #fee2e2; color: #b91c1c; }
.badge-priority-높음 { background: #ffedd5; color: #c2410c; }
.badge-priority-보통 { background: #e0e7ff; color: #3730a3; }
.badge-priority-낮음 { background: #f3f4f6; color: #374151; }

.btn {
  display: inline-block;
  background: #2563eb; color: #fff; border: none; padding: 8px 14px;
  border-radius: 6px; font-size: 13px; cursor: pointer;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

form.inline { display: inline; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
  font-family: inherit;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-group.form-group-shrink { flex: 0 0 auto; }
.form-group.form-group-shrink .btn { white-space: nowrap; }

/* 날짜 입력 필드가 본문과 다른 폰트로 보이는 것 방지 (Chrome/Edge) */
input[type="date"] {
  font-family: inherit;
  color: #1f2328;
}
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  font-family: inherit;
  font-size: inherit;
}
input[type="date"]:not(:focus):in-range::-webkit-datetime-edit-year-field,
input[type="date"]:not(:focus):in-range::-webkit-datetime-edit-month-field,
input[type="date"]:not(:focus):in-range::-webkit-datetime-edit-day-field,
input[type="date"]:not(:focus):in-range::-webkit-datetime-edit-text {
  color: #1f2328;
}

.error-msg { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.success-msg { background: #dcfce7; color: #166534; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }

.checkbox-group {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; background: #fafafa;
  min-height: 38px; align-items: center;
}
.checkbox-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: normal; white-space: nowrap; }
.checkbox-item input { width: auto; }

.progress-bar-bg { background: #e5e7eb; border-radius: 6px; height: 8px; width: 100%; overflow: hidden; }
.progress-bar-fill { background: #2563eb; height: 100%; }

.login-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-box { background: #fff; padding: 32px; border-radius: 10px; width: 320px; border: 1px solid #e5e7eb; }
.login-box h1 { text-align: center; }

.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.muted { color: #6b7280; font-size: 13px; }
.comment { border-bottom: 1px solid #f0f0f0; padding: 10px 0; }
.comment .meta { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.link-btn-danger { background: none; border: none; color: #b91c1c; cursor: pointer; font-size: 12px; padding: 0; margin-left: 6px; text-decoration: underline; }
.item-tree { margin-top: 6px; padding-left: 14px; border-left: 2px solid #e5e7eb; }
.item-tree summary { font-size: 12px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachment-thumb img { max-width: 160px; max-height: 160px; border-radius: 6px; border: 1px solid #e5e7eb; display: block; }
.attachment-file { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px; }
.file-hint { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* 간트 차트 */
.gantt-range { margin-bottom: 10px; }
.gantt-chart { display: flex; flex-direction: column; gap: 10px; }
.gantt-row {
  display: grid;
  grid-template-columns: 160px 1fr 150px;
  align-items: center;
  gap: 12px;
}
.gantt-label {
  font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-track {
  position: relative; background: #f3f4f6; border-radius: 5px; height: 20px;
}
.gantt-today-line {
  position: absolute; top: -3px; bottom: -3px; width: 2px; background: #dc2626; z-index: 2;
}
.gantt-bar {
  position: absolute; top: 0; height: 100%; border-radius: 5px;
  background: #e5e7eb; overflow: hidden; min-width: 6px;
}
.gantt-bar-fill { height: 100%; background: rgba(0, 0, 0, 0.28); }
.gantt-bar-status-예정 { background: #fde68a; }
.gantt-bar-status-진행중 { background: #93c5fd; }
.gantt-bar-status-완료 { background: #86efac; }
.gantt-bar-status-지연 { background: #fca5a5; }
.gantt-dates { font-size: 12px; text-align: right; white-space: nowrap; }
.gantt-legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend-예정 { background: #fde68a; }
.legend-진행중 { background: #93c5fd; }
.legend-완료 { background: #86efac; }
.legend-지연 { background: #fca5a5; }
.legend-today { background: #dc2626; width: 3px; height: 12px; border-radius: 1px; }

/* 모바일 화면 대응: 레이아웃 정리 + 전반적으로 글자 크기를 키워서 가독성 확보 */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 10px; margin: 14px auto; }

  .navbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .navbar nav { order: 3; width: 100%; }
  .navbar nav a { margin-right: 12px; font-size: 15px; }
  .navbar .user-info { font-size: 14px; }

  .card { padding: 14px; }

  h1 { font-size: 20px; }
  h2 { font-size: 18px; }
  h3 { font-size: 16px; }

  .section-title-row { flex-wrap: wrap; gap: 8px; }

  .form-row { flex-direction: column; gap: 0; }
  .form-group label { font-size: 14px; }
  /* 입력창은 16px 이상이어야 iOS Safari에서 탭할 때 자동 확대(줌)가 안 걸립니다 */
  .form-group input, .form-group select, .form-group textarea { font-size: 16px; }

  table { font-size: 15px; }
  th, td { padding: 8px 6px; }
  th { font-size: 13px; }

  .muted { font-size: 14px; }
  .badge { font-size: 13px; }
  .btn { font-size: 15px; padding: 10px 16px; }
  .btn-sm { font-size: 13px; padding: 6px 12px; }

  .gantt-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .gantt-dates { text-align: left; }
  .gantt-label { font-size: 14px; }

  .login-box { width: 90%; max-width: 320px; padding: 24px; }
}
