:root {
  --ksta-font: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', Roboto, Inter, sans-serif;
  --ksta-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #7c3aed;
  --success: #16a34a;
  --warning: #d97706;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', Roboto, Inter, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover { text-decoration: none; }

button, input, select, textarea {
  font: inherit;
}

.page {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 22px 16px 40px;
}

.header-card,
.card {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.header-card {
  padding: 20px;
  margin-bottom: 16px;
}

.card {
  padding: 18px;
  margin-bottom: 16px;
}

.hero {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary-strong);
  font-weight: 700;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.page-title,
.card h3,
.hero h2 {
  margin: 0;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
}

.page-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.section-gap {
  margin-top: 14px;
}

.subnav,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subnav a,
.tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: var(--surface-soft);
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.subnav a:hover,
.tabs a:hover,
.btn:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

.subnav a[aria-current="page"],
.tabs a[aria-current="page"],
.subnav a.active,
.tabs a.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.grid,
.grid-3 {
  display: grid;
  gap: 16px;
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-item {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.value-muted,
.helper,
.footer {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 13px;
}

.input-row,
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.input {
  flex: 1 1 320px;
  min-width: 0;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

.input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}

.btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.btn-secondary {
  background: #f8fafc;
  color: #334155;
  border-color: rgba(148, 163, 184, 0.24);
}

.link-disabled,
[aria-disabled="true"] {
  opacity: 0.6;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

tr:last-child td,
tr:last-child th {
  border-bottom: 0;
}

.footer {
  margin-top: 18px;
  font-size: 13px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 768px) {
  .page {
    padding: 16px 12px 32px;
  }

  .header-card,
  .card {
    border-radius: 20px;
    padding: 16px;
  }

  .topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta {
    text-align: left;
  }

  .subnav,
  .tabs,
  .btn-row,
  .input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .subnav a,
  .tabs a,
  .btn,
  .btn-secondary {
    width: 100%;
  }

  .kpi {
    font-size: 24px;
  }
}
