/* 전체 레이아웃 */
* { box-sizing: border-box; }

body { font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; }

/* 사이드바 */
#sidebar {
  transition: transform 0.3s ease;
}

/* 테이블 스타일 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: #1e40af;
  color: white;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: right;
  white-space: nowrap;
}
.data-table td.text-left { text-align: left; }
.data-table td.text-center { text-align: center; }
.data-table tr:hover { background: #f0f9ff; }
.data-table tr.total-row {
  background: #eff6ff;
  font-weight: 700;
  border-top: 2px solid #1e40af;
}

/* 증감 색상 */
.positive { color: #dc2626; }
.negative { color: #2563eb; }
.zero { color: #6b7280; }

/* 카드 */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 모달 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

/* 버튼 */
.btn-primary {
  background: #1e40af;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary {
  background: #6b7280;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.btn-danger {
  background: #dc2626;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
}
.btn-success {
  background: #16a34a;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

/* 입력 폼 */
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.form-input:focus { border-color: #1e40af; box-shadow: 0 0 0 2px rgba(30,64,175,0.1); }

/* 알림 뱃지 */
.badge-red { background: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: 9999px; font-size: 12px; }
.badge-green { background: #dcfce7; color: #16a34a; padding: 2px 8px; border-radius: 9999px; font-size: 12px; }
.badge-yellow { background: #fef9c3; color: #ca8a04; padding: 2px 8px; border-radius: 9999px; font-size: 12px; }
.badge-blue { background: #dbeafe; color: #1d4ed8; padding: 2px 8px; border-radius: 9999px; font-size: 12px; }

/* 로딩 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #6b7280;
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #1e40af;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 보고서 인쇄 스타일 */
@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #main-content { margin: 0 !important; padding: 0 !important; }
  .data-table th { background: #1e40af !important; -webkit-print-color-adjust: exact; }
}

/* 파일 업로드 드래그앤드롭 */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: #1e40af;
  background: #eff6ff;
}

/* 탭 */
.tab-btn {
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  transition: all 0.2s;
}
.tab-btn.active {
  border-bottom-color: #1e40af;
  color: #1e40af;
  font-weight: 600;
}

/* 스크롤바 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
