* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Malgun Gothic', '맑은 고딕', 'Segoe UI', sans-serif;
  background: #f4f6f9;
  min-height: 100vh;
}

/* 헤더 */
.page-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
  color: white;
  padding: 0 30px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #1e3a5f;
  font-size: 14px;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.15);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.header-home-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* 비밀번호 화면 */
.password-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f4f6f9;
  z-index: 9999;
}

.password-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 20px rgba(30, 58, 95, 0.15);
  padding: 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.password-container h1 {
  color: #1e3a5f;
  margin-bottom: 10px;
  font-size: 24px;
}

.password-container .subtitle {
  color: #5a7a9a;
  margin-bottom: 30px;
}

.password-container .form-group {
  text-align: left;
  margin-bottom: 20px;
}

.password-container .btn {
  width: 100%;
}

.password-error {
  color: #e53935;
  font-size: 14px;
  margin-top: 15px;
  min-height: 20px;
}

/* 메인 컨텐츠 */
.main-content {
  padding-top: 80px;
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 30px;
}

.last-modified {
  position: fixed;
  top: 70px;
  right: 20px;
  font-size: 12px;
  color: #1e3a5f;
  background: rgba(232, 244, 253, 0.95);
  padding: 5px 12px;
  border-radius: 4px;
  z-index: 999;
  border: 1px solid #c3daf0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 30px;
}

h1 {
  color: #1e3a5f;
  margin-bottom: 10px;
  font-size: 24px;
}

.subtitle {
  color: #5a7a9a;
  margin-bottom: 25px;
  font-size: 14px;
}

/* 폼 섹션 */
.credentials-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
}

.credentials-section h2 {
  color: #1e3a5f;
  margin-bottom: 20px;
  font-size: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #1e3a5f;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #1e3a5f;
  font-size: 13px;
}

.form-group input {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* 버튼 그룹 */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #1e3a5f;
  color: white;
}

.btn-primary:hover {
  background: #2c5282;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
  background: #64748b;
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  flex: none;
  width: auto;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-success {
  background: #059669;
  color: white;
}

.btn-success:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* 로그 섹션 */
.log-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.log-header h2 {
  color: #1e3a5f;
  font-size: 16px;
}

.log-container {
  background: #0f172a;
  border-radius: 8px;
  padding: 18px;
  max-height: 350px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #334155;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  color: #e2e8f0;
}

.log-entry {
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-left: 3px solid #64748b;
  color: #e2e8f0;
  background: rgba(100, 116, 139, 0.1);
}

.log-entry.info {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border-left-color: #38bdf8;
}

.log-entry.success {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border-left-color: #4ade80;
}

.log-entry.warning {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border-left-color: #fbbf24;
}

.log-entry.error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  border-left-color: #f87171;
}

/* 진행률 섹션 */
.status-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
}

.status-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.status-item:last-child {
  margin-bottom: 0;
}

.status-label {
  font-weight: 600;
  color: #1e3a5f;
  margin-right: 15px;
  min-width: 80px;
  font-size: 13px;
}

.status-value {
  color: #475569;
  font-weight: 500;
}

.progress-bar {
  flex: 1;
  height: 28px;
  background: #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e3a5f, #3b82f6);
  width: 0%;
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #1e3a5f;
  font-weight: 600;
  font-size: 12px;
}

/* 다운로드 섹션 */
.download-section {
  background: linear-gradient(135deg, #1e3a5f, #2c5282);
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  color: white;
}

.download-section h2 {
  color: white;
  margin-bottom: 12px;
  font-size: 18px;
}

.download-info {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 18px;
  font-size: 14px;
}

/* 결과 섹션 */
.results-section {
  margin-top: 25px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: linear-gradient(135deg, #1e3a5f, #2c5282);
  color: white;
  padding: 18px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.2);
}

.stat-card h3 {
  font-size: 26px;
  margin-bottom: 6px;
  font-weight: 700;
}

.stat-card p {
  font-size: 12px;
  opacity: 0.9;
}

.chart-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #1e3a5f;
  text-align: center;
}

#standardChart {
  width: 100%;
  margin: 0 auto;
  height: 300px;
  max-height: 600px;
}

.table-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
}

.data-table thead {
  background: #1e3a5f;
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
}

.data-table th {
  font-weight: 600;
}

.data-table tbody tr:hover {
  background: #f1f5f9;
}

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

/* 반응형 */
@media (max-width: 768px) {
  .page-header {
    padding: 0 15px;
  }

  .main-content {
    padding: 70px 15px 20px 15px;
  }

  .container {
    padding: 20px;
  }

  h1 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 11px;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }
}
