:root {
  --bg: #ffffff;
  --bg-accent: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #f3f4f6;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0078d4;
  --brand-deep: #106ebe;
  --copilot: linear-gradient(135deg, #5b6cf9 0%, #a855f7 50%, #ec4899 100%);
  --healthy: #107c10;
  --warning: #c47b00;
  --danger: #c50f1f;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Malgun Gothic",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* ── 상단 네비 바 ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}

.topbar-logo svg {
  flex-shrink: 0;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}

.topbar-title {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── 레이아웃 ────────────────────────────────────────────────────── */
.shell {
  width: min(1280px, calc(100vw - 48px));
  margin: 32px auto 48px;
}

/* ── 히어로 ──────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 24px;
  padding: 36px 40px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: var(--copilot);
  opacity: 0.08;
  filter: blur(40px);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: transparent;
  background: var(--copilot);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-text {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 52ch;
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.metric-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-accent);
  border: 1px solid var(--line);
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.metric-card strong {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  background: var(--copilot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── 워크스페이스 ─────────────────────────────────────────────────── */
.workspace {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

/* ── 툴바 ────────────────────────────────────────────────────────── */
.toolbar {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

.search-field {
  display: grid;
  gap: 6px;
  min-width: min(100%, 380px);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.date-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.search-field input,
.date-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg-accent);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
  outline: none;
}

.search-field input:focus,
.date-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.12);
  background: #fff;
}

.primary-button {
  appearance: none;
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: 10px 18px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

.primary-button:hover { background: var(--brand-deep); }

.status-message {
  width: 100%;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-message.is-success { color: var(--healthy); }
.status-message.is-error { color: var(--danger); }

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip,
.ghost-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms ease;
}

.chip {
  background: var(--bg-accent);
  color: var(--muted);
  border: 1px solid var(--line);
}

.chip:hover {
  background: #ececec;
  color: var(--ink);
}

.chip.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.ghost-button {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(0, 120, 212, 0.3);
}

.ghost-button:hover {
  background: rgba(0, 120, 212, 0.06);
}

/* ── 그리드 패널 ──────────────────────────────────────────────────── */
.panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brand);
}

.panel h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.volume-summary {
  color: var(--muted);
  font-size: 0.875rem;
}

.volume-summary strong {
  margin-left: 6px;
  color: var(--ink);
  font-size: 1rem;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 5px;
  vertical-align: middle;
}

.healthy { background: var(--healthy); }
.warning { background: var(--warning); }
.critical { background: var(--danger); }

/* ── 그리드 ──────────────────────────────────────────────────────── */
.grid-frame {
  height: 600px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* ── 상태 뱃지 ───────────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pill.is-healthy {
  color: var(--healthy);
  background: rgba(16, 124, 16, 0.1);
}

.status-pill.is-warning {
  color: var(--warning);
  background: rgba(196, 123, 0, 0.1);
}

.status-pill.is-critical {
  color: var(--danger);
  background: rgba(197, 15, 31, 0.1);
}

/* ── 프로그레스 ──────────────────────────────────────────────────── */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--copilot);
}

/* ── 반응형 ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 28px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: calc(100vw - 24px);
    margin-top: 20px;
  }

  .topbar {
    padding: 0 16px;
  }

  .hero,
  .toolbar,
  .panel {
    padding: 18px;
  }

  .grid-frame {
    height: 520px;
  }

  .search-form,
  .search-field,
  .date-field {
    width: 100%;
  }
}
