:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #0f172a;
  --light: #f8fafc;
  --surface: #ffffff;
  --text-main: #334155;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-lg: 16px;
  --radius-md: 12px;
}

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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--light);
  color: var(--text-main);
  padding: 2rem;
  line-height: 1.5;
  background-image: radial-gradient(circle at 50% 0%, #e2e8f0 0%, transparent 70%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
}

header {
  grid-column: 1 / -1;
  background: var(--dark);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-md);
}

header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

header h1 small {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 300;
  font-size: 0.875rem;
  opacity: 0.8;
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

#date {
  font-size: 0.9rem;
  font-weight: 500;
  color: #cbd5e1;
}

/* Control Panel */
.panel {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  height: fit-content;
}

.panel h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--dark);
  font-weight: 700;
}

.scenario-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.control-group {
  margin-bottom: 1.5rem;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark);
}

.control-group label span {
  color: var(--primary);
  font-weight: 700;
}

.slider {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  transition: background 0.3s;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 4px solid white;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.btn-run {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-run:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-run:active {
  transform: translateY(0);
}

/* Dashboard */
.dashboard {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card span {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card h3 {
  font-size: 2rem;
  margin-top: 0.5rem;
  font-weight: 700;
}

.chart-container {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  height: 400px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

/* AIHP Agent Feedback */
.ai-feedback {
  background: #f0fdf4;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-top: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid #bbf7d0;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.5s ease-out;
}

.ai-avatar {
  width: 48px;
  height: 48px;
  background: var(--secondary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.ai-msg {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #166534;
}

.ai-msg strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #14532d;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .container {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  body {
    padding: 1rem;
  }
}