/* ===== 관리자 스타일 ===== */

/* 로그인 모달 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(3px);
}

.modal-box {
  background: white;
  border-radius: 16px;
  padding: 36px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}

.modal-box.modal-lg {
  max-width: 740px;
  text-align: left;
  padding: 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 12px;
}

.modal-box h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.modal-box > p {
  font-size: 14px;
  color: var(--gray-600);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.modal-header h3 i {
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

/* 관리자 메인 */
.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* 통계 바 */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.all  { background: #e8f0fe; color: var(--primary); }
.stat-icon.ec   { background: #fef3e2; color: #e67e00; }
.stat-icon.co   { background: #e6f9f0; color: var(--success); }
.stat-icon.ok   { background: #e8f5e9; color: #2e7d32; }

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* 툴바 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--gray-600);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab.active {
  background: white;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  padding: 7px 12px;
  background: white;
}

.search-box i {
  color: var(--gray-400);
  font-size: 13px;
}

.search-box input {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  width: 180px;
  color: var(--gray-800);
}

/* 테이블 */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 700;
  font-size: 12px;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
  letter-spacing: 0.3px;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: var(--gray-50);
}

.admin-table td.empty-row {
  text-align: center;
  color: var(--gray-400);
  padding: 40px;
  font-size: 14px;
}

.program-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-ec { background: #fef3e2; color: #b06a00; }
.chip-co { background: #e6f9f0; color: var(--success); }

/* 버튼 */
.btn-icon {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-600);
  transition: var(--transition);
}

.btn-icon:hover { background: var(--gray-100); }
.btn-icon.primary { border-color: var(--primary); color: var(--primary); }
.btn-icon.primary:hover { background: var(--primary-light); }
.btn-icon.danger { border-color: var(--danger); color: var(--danger); }
.btn-icon.danger:hover { background: var(--danger-light); }

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #b02218;
}

.btn-danger-outline {
  background: white;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-danger-outline:hover {
  background: var(--danger-light);
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 700; }

/* 상세 정보 그리드 */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.detail-value {
  font-size: 14px;
  color: var(--gray-900);
  font-weight: 500;
}

.detail-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-100);
}

.detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.signature-thumb {
  max-width: 100%;
  max-height: 140px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: white;
}

/* 반응형 */
@media (max-width: 900px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .admin-table { min-width: 900px; }
}

@media (max-width: 640px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
}
