/* ========== CSS 변수 (Color Palette & Typography) ========== */
:root {
  /* 주색상 */
  --primary-color: #004137;
  --primary-light: #005a4d;

  /* 배경색 */
  --bg-primary: #fafafa;
  --bg-white: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.7);

  /* 텍스트 색상 */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-white: #ffffff;

  /* 상태 색상 */
  --success: #10b981;
  --error: #dc3545;
  --warning: #f59e0b;

  /* 테두리 */
  --border-light: #e5e7eb;
  --border-dashed: #a1a1a1;

  /* 폰트 크기 */
  --font-xs: 10px;
  --font-sm: 12px;
  --font-md: 14px;
  --font-lg: 16px;
  --font-xl: 20px;
  --font-2xl: 28px;
}

/* ========== 전역 리셋 및 기본 스타일 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "돋움",
    "dotum", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-sm);
  line-height: 1.6;
}

/* ========== 레이아웃 ========== */
.container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 10px;
}

.content {
  min-height: calc(100vh - 60px);
}

.maincontent {
  margin-left: 200px;
  transition: margin-left 0.3s;
}

/* ========== 페이지 제목 ========== */
.contentTitle {
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: #004137;
  color: #fff;
  border-radius: 5px;
  margin: 10px;
  box-sizing: border-box;
}

.contentTitle .material-symbols-outlined {
  font-size: 20px;
  margin-right: 10px;
}

/* ========== 버튼 스타일 ========== */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-white);
  padding: 8px 16px;
  border-radius: 5px;
  font-size: var(--font-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 8px 16px;
  border-radius: 5px;
  font-size: var(--font-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background-color: var(--bg-primary);
  border-color: var(--primary-color);
}

.btn-excel {
  background-color: #1f7a1f;
  color: var(--text-white);
  border: 1px solid #166316;
}

.btn-excel:hover {
  background-color: #166316;
  transform: translateY(-1px);
}

.btn-small {
  padding: 4px 8px;
  font-size: var(--font-xs);
  border-radius: 5px;
  background-color: var(--primary-color);
  color: var(--text-white);
}

.btn-small:hover {
  background-color: var(--primary-light);
}

.btn-danger {
  background-color: var(--error);
  color: var(--text-white);
}

.btn-danger:hover {
  background-color: #c82333;
}

/* ========== 테이블 스타일 ========== */
.table-container {
  background: white;
  border-radius: 5px;
  padding: 15px;
  margin: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}

.data-table th {
  background-color: #4b5563;
  color: var(--text-white);
  font-weight: 600;
  padding: 10px;
  text-align: left;
  border-bottom: 2px solid #374151;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr:hover {
  background-color: var(--bg-primary);
}

.data-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* ========== 폼 요소 ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  font-size: var(--font-sm);
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
}

label {
  display: block;
  font-weight: 500;
  font-size: var(--font-sm);
}

.form-group {
  margin-bottom: 15px;
}

/* 토글 스위치 스타일 */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

/* ========== 필터 섹션 ========== */
.filter-section {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: var(--font-sm);
  font-weight: 500;
}

/* ========== 페이지네이션 ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination button {
  padding: 6px 12px;
  background-color: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  cursor: pointer;
}

.pagination button:hover {
  background-color: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
}

.pagination span {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* ========== 모달 스타일 ========== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border: 1px solid #888;
  border-radius: 5px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content form {
  padding: 20px;
}

.modal-header {
  padding: 15px 20px;
  background-color: var(--primary-color);
  color: #fff;
  border-radius: 5px 5px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: var(--font-lg);
}

.close {
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
}

.close:hover {
  color: #ccc;
}

/* ========== 모바일 헤더 ========== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 60px;
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  z-index: 1000;
  padding: 0 15px;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #333;
}

.mobile-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* ========== 반응형 ========== */
@media (max-width: 1024px) {
  .maincontent {
    margin-left: 0;
    padding-top: 60px;
  }

  .mobile-header {
    display: flex;
  }
}

/* 날짜 입력 wrapper 스타일 */
.date-wrapper {
  cursor: pointer !important;
}

.date-wrapper * {
  cursor: pointer !important;
}

.date-wrapper input[type="date"],
.date-wrapper .date-picker {
  cursor: pointer !important;
}
