/* ───────────────────────────────────────────────────────────────
   SCARZ Admin — design system
   palette: indigo #4f46e5  /  purple #a855f7  /  ink #0a0e2a
   ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg:          #f6f8fc;
  --surface:     #ffffff;
  --surface-2:   #f0f3fa;
  --ink:         #0a0e2a;
  --ink-soft:    #475569;
  --ink-mute:    #94a3b8;
  --line:        rgba(15,23,42,.08);
  --line-strong: rgba(15,23,42,.16);
  --accent:      #4f46e5;
  --accent-2:    #a855f7;
  --accent-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  --ok:          #10b981;
  --warn:        #f59e0b;
  --err:         #ef4444;
  --sidebar:     #0a0e2a;
  --sidebar-soft:#1a1f3f;
  --radius:      14px;
  --radius-sm:   10px;
  --shadow-sm:   0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow:      0 4px 24px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-lg:   0 12px 48px rgba(15,23,42,.10), 0 4px 12px rgba(15,23,42,.06);
  --font:        'Pretendard','Space Grotesk',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --font-mono:   'JetBrains Mono','Menlo',monospace;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ── shell layout ──────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: #cbd5e1;
  padding: 24px 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 4px 24px 24px;
  font-size: 20px; font-weight: 700; letter-spacing: -.02em;
  color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.sidebar .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(168,85,247,.5);
}
.sidebar nav { flex: 1; padding: 8px 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin: 2px 0;
  color: #cbd5e1; font-weight: 500; font-size: 13.5px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  text-decoration: none;
}
.sidebar nav a:hover { background: var(--sidebar-soft); color: #fff; }
.sidebar nav a.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(91,108,255,.35);
}
.sidebar nav .group-label {
  margin: 14px 6px 4px;
  padding: 12px 8px 6px;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: #64748b;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar nav .group-label--first {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 0;
}
.sidebar .footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 12px; color: #64748b;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar .footer a { color: #94a3b8; }

.main {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar .crumbs {
  font-size: 13px; color: var(--ink-soft);
}
.topbar .crumbs strong { color: var(--ink); }
.topbar .user {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
}
.topbar .user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.topbar .user a { color: var(--ink-soft); }

.content { padding: 32px; max-width: 1400px; width: 100%; }

.page-head { margin-bottom: 24px; }
.page-head h1 {
  margin: 0 0 6px; font-size: 24px; font-weight: 700;
  letter-spacing: -.02em;
}
.page-head p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ── cards / stats ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .label {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-mute);
}
.stat .value {
  margin-top: 8px;
  font-size: 30px; font-weight: 700; letter-spacing: -.02em;
  font-family: var(--font-mono);
  color: var(--ink);
}
.stat .delta {
  margin-top: 6px;
  font-size: 12px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px;
}
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--err); }
.stat .accent-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--accent-grad);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card .card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card .card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card .card-body { padding: 22px; }

/* ── progress ───────────────────────────────────────────────────── */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.progress-card .row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.progress-card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.progress-card .nums {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--ink-soft);
}
.progress-card .nums strong { color: var(--ink); font-size: 15px; }
.progress-bar {
  height: 10px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden;
  position: relative;
}
.progress-bar .fill {
  height: 100%;
  background: var(--accent-grad);
  background-size: 200% 200%;
  border-radius: 999px;
  animation: bar-shimmer 4s ease-in-out infinite;
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes bar-shimmer {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}

/* ── status pills ──────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.s-planned   { background: #f1f5f9; color: #64748b; }
.pill.s-building  { background: #fff7ed; color: #c2410c; }
.pill.s-deployed  { background: #eff6ff; color: #1d4ed8; }
.pill.s-indexed   { background: #ecfeff; color: #0e7490; }
.pill.s-live      { background: #ecfdf5; color: #047857; }
.pill.s-paused    { background: #fef2f2; color: #b91c1c; }

/* ── table ──────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 22px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-weight: 600; color: var(--ink-soft);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  background: var(--surface-2);
}
.table tr:hover td { background: rgba(91,108,255,.03); }
.table tr:last-child td { border-bottom: none; }

/* ── empty state ───────────────────────────────────────────────── */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-mute);
}
.empty .emoji { font-size: 32px; margin-bottom: 8px; opacity: .5; }
.empty h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink-soft); }
.empty p { margin: 0; font-size: 13px; }

/* ── buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink);
  transition: transform .1s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff; background: var(--accent-grad);
  background-size: 200% 200%;
  box-shadow: 0 4px 14px rgba(91,108,255,.3);
  animation: btn-shift 6s ease-in-out infinite;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(91,108,255,.45); }
@keyframes btn-shift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

/* ── login page ────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(91,108,255,.10), transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 70%, rgba(168,85,247,.10), transparent 60%),
    var(--bg);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(15,23,42,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 90%);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
  margin-bottom: 4px;
}
.login-card .brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(168,85,247,.4);
}
.login-card h1 {
  margin: 18px 0 6px; font-size: 24px; letter-spacing: -.02em;
}
.login-card .sub {
  margin: 0 0 28px; color: var(--ink-soft); font-size: 13.5px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .06em;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px; font-family: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(91,108,255,.12);
}
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-ok  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.btn-block { width: 100%; padding: 13px; font-size: 14px; }

.login-card .meta {
  margin-top: 22px;
  text-align: center;
  font-size: 12px; color: var(--ink-mute);
  font-family: var(--font-mono);
  letter-spacing: .1em; text-transform: uppercase;
}

/* ── page header w/ actions ────────────────────────────────────── */
.page-head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head-row .page-head { margin-bottom: 0; }
.page-actions { display: flex; gap: 8px; }

/* ── filter bar ────────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.filter-bar form {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  width: 100%;
}
.filter-bar .grow { flex: 1; min-width: 200px; }
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"] {
  padding: 9px 12px;
  font-size: 13px; font-family: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  min-width: 140px;
  transition: border-color .15s, box-shadow .15s;
}
.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(91,108,255,.12);
}
.filter-bar .input-search { flex: 1; min-width: 220px; }

/* ── inline mini form (status change etc) ──────────────────────── */
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form select,
.inline-form input {
  padding: 6px 10px;
  font-size: 12px; font-family: inherit;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}
.inline-form button {
  padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
}
.inline-form button.primary {
  background: var(--accent-grad);
  color: #fff; border-color: transparent;
}

/* ── pagination ────────────────────────────────────────────────── */
.pagination {
  display: flex; gap: 4px; justify-content: center;
  padding: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.pagination a:hover { background: var(--surface-2); color: var(--ink); }
.pagination .current {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 2px 8px rgba(91,108,255,.3);
}
.pagination .disabled { color: var(--ink-mute); pointer-events: none; }

/* ── form grid (modal/add) ─────────────────────────────────────── */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.form-grid .field { margin-bottom: 0; }
.field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  resize: vertical; min-height: 80px;
}
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(91,108,255,.12);
}
.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px; font-family: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 18px;
}

/* ── modal (CSS-only :target) ──────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(10,14,42,.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 64px 20px 20px; z-index: 50;
  backdrop-filter: blur(4px);
}
.modal:target { display: flex; }
.modal-box {
  background: var(--surface);
  width: 100%; max-width: 560px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in .2s ease-out;
}
@keyframes modal-in {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-head .close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--ink-mute);
  font-size: 18px; font-weight: 400;
  text-decoration: none;
}
.modal-head .close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 22px; }

/* ── small helpers ─────────────────────────────────────────────── */
.muted { color: var(--ink-mute); }
.mono  { font-family: var(--font-mono); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.role-pill {
  display: inline-block; padding: 2px 9px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  border-radius: 999px;
  text-transform: uppercase;
}
.role-pill.admin  { background: #ede9fe; color: #5b21b6; }
.role-pill.staff  { background: #e0f2fe; color: #0369a1; }
.role-pill.client { background: #fef3c7; color: #92400e; }
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 6px; vertical-align: middle;
}
.status-dot.on  { background: var(--ok); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.status-dot.off { background: var(--ink-mute); }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD VISUAL COMPONENTS
   ─────────────────────────────────────────────────────────────── */

/* ── Hero 진척도 (큰 도넛 + 6개월 타임라인) ─────────────────────── */
.hero {
  position: relative; overflow: hidden;
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
  background:
    radial-gradient(circle at 90% 10%, rgba(168,85,247,.18), transparent 55%),
    radial-gradient(circle at 10% 100%, rgba(79,70,229,.22), transparent 50%),
    linear-gradient(135deg, #0a0e2a 0%, #1a1f4a 50%, #2d1b69 100%);
  color: #fff;
  box-shadow: 0 20px 60px rgba(79,70,229,.25);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 280px 1fr; gap: 36px;
  align-items: center;
}
.hero-gauge {
  position: relative;
  width: 240px; height: 240px;
  display: flex; align-items: center; justify-content: center;
}
.hero-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-gauge .track { stroke: rgba(255,255,255,.08); }
.hero-gauge .fill {
  stroke: url(#heroGrad);
  stroke-linecap: round;
  filter: drop-shadow(0 0 16px rgba(168,85,247,.6));
  transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1);
}
.hero-gauge .center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.hero-gauge .pct {
  font-family: var(--font-mono);
  font-size: 44px; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.hero-gauge .pct sup { font-size: 18px; vertical-align: top; opacity: .8; margin-left: 2px; }
.hero-gauge .sub {
  margin-top: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .15em;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
}

.hero-stats { display: flex; flex-direction: column; gap: 18px; }
.hero-stats .title {
  font-size: 20px; font-weight: 700; letter-spacing: -.02em;
  margin: 0;
}
.hero-stats .title small {
  display: block; margin-top: 4px;
  font-size: 12.5px; font-weight: 500; letter-spacing: .02em;
  color: rgba(255,255,255,.6);
}
.hero-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.hero-kpi {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
  transition: transform .2s, background .2s;
}
.hero-kpi:hover { transform: translateY(-2px); background: rgba(255,255,255,.09); }
.hero-kpi .k-label {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.55);
}
.hero-kpi .k-value {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 24px; font-weight: 700; letter-spacing: -.02em;
}
.hero-kpi .k-bar {
  margin-top: 8px;
  height: 3px; border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.hero-kpi .k-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #a855f7);
}
.hero-kpi.ok    .k-bar i { background: linear-gradient(90deg, #10b981, #34d399); }
.hero-kpi.warn  .k-bar i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.hero-kpi.indigo .k-bar i { background: linear-gradient(90deg, #4f46e5, #a855f7); }

/* ── 1500칸 히트맵 그리드 ──────────────────────────────────────── */
.heatmap-card { padding: 24px; }
.heatmap-card .card-head { padding: 0 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; display:flex; justify-content:space-between; align-items:center; }
.heatmap-card .card-head h2 { margin:0; font-size:15px; font-weight:600; }

.heatmap-legend {
  display: flex; gap: 14px; align-items: center;
  font-size: 11.5px; color: var(--ink-soft);
}
.heatmap-legend .item { display: flex; gap: 6px; align-items: center; }
.heatmap-legend .swatch {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,.06);
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(50, 1fr);
  gap: 3px;
  padding: 4px;
}
.heatmap .cell {
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: #f1f5f9;
  position: relative;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.heatmap .cell:hover {
  transform: scale(1.6); z-index: 10;
  box-shadow: 0 4px 12px rgba(15,23,42,.18);
}
.heatmap .cell.s-empty    { background: #f1f5f9; }
.heatmap .cell.s-planned  { background: #cbd5e1; }
.heatmap .cell.s-building { background: #fdba74; }
.heatmap .cell.s-deployed { background: #93c5fd; }
.heatmap .cell.s-indexed  { background: #67e8f9; }
.heatmap .cell.s-live     { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 0 6px rgba(16,185,129,.4); }
.heatmap .cell.s-paused   { background: #fca5a5; }

.heatmap-tooltip {
  position: fixed;
  background: var(--ink);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity .12s;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.heatmap-tooltip.show { opacity: 1; }

/* ── 차트 카드 ────────────────────────────────────────────────── */
.chart-card { padding: 22px; }
.chart-card .card-head { padding: 0 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; display:flex; justify-content:space-between; align-items:center; }
.chart-card .card-head h2 { margin:0; font-size:14px; font-weight:600; }
.chart-card .card-head .sub { font-size: 11.5px; color: var(--ink-mute); font-weight: 500; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.sm { height: 200px; }

/* 도넛 차트 가운데 라벨 */
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-center .big {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 800; letter-spacing: -.02em;
}
.donut-center .lbl {
  font-size: 11px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: .1em; font-weight: 600;
  margin-top: 2px;
}

/* ── 도메인 스택바 ────────────────────────────────────────────── */
.dom-legend {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 11.5px; color: var(--ink-soft);
}
.dom-legend .item { display: inline-flex; gap: 6px; align-items: center; }
.dom-legend .swatch {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,.06);
}
.dom-stack { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.dom-row { display: grid; grid-template-columns: 160px 1fr 80px; gap: 12px; align-items: center; }
.dom-row .dom-name {
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 500;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dom-row .dom-bar {
  display: flex; height: 22px;
  border-radius: 8px; overflow: hidden;
  background: #f1f5f9;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
}
.dom-row .dom-bar > span {
  height: 100%;
  transition: filter .15s;
  position: relative;
}
.dom-row .dom-bar > span:hover { filter: brightness(1.1); }
.dom-row .dom-bar .seg-planned  { background: #cbd5e1; }
.dom-row .dom-bar .seg-building { background: #fdba74; }
.dom-row .dom-bar .seg-deployed { background: #93c5fd; }
.dom-row .dom-bar .seg-indexed  { background: #67e8f9; }
.dom-row .dom-bar .seg-live     { background: linear-gradient(90deg, #10b981, #34d399); }
.dom-row .dom-bar .seg-paused   { background: #fca5a5; }
.dom-row .dom-count {
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft);
  text-align: right;
}

/* ── TOP 사이트 리스트 + 스파크라인 ───────────────────────────── */
.top-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.top-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 90px 110px;
  gap: 14px; align-items: center;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.top-row:last-child { border-bottom: none; }
.top-row:hover { background: rgba(91,108,255,.03); }
.top-row .rank {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  color: var(--ink-mute);
  text-align: center;
}
.top-row .rank.gold   { color: #d97706; }
.top-row .rank.silver { color: #64748b; }
.top-row .rank.bronze { color: #92400e; }
.top-row .host {
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 500;
  color: var(--ink);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-row .host a { color: inherit; display: block; overflow: hidden; text-overflow: ellipsis; }
.top-row .host a:hover { color: var(--accent); text-decoration: none; }
.top-row .spark-wrap {
  position: relative;
  width: 90px; height: 30px;
}
.top-row .spark-wrap canvas {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
}
.top-row .top-num {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  text-align: right;
  color: var(--ink);
  line-height: 1.2;
}
.top-row .top-num small {
  display: block;
  font-family: var(--font);
  font-size: 10.5px; color: var(--ink-mute);
  font-weight: 500; letter-spacing: .02em;
  margin-top: 2px;
}

/* ── 그리드 레이아웃 ─────────────────────────────────────────── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-gauge { margin: 0 auto; }
  .hero-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-2, .dash-grid-3 { grid-template-columns: 1fr; }
  .heatmap { grid-template-columns: repeat(30, 1fr); }
}
@media (max-width: 600px) {
  .hero { padding: 22px; }
  .hero-gauge { width: 180px; height: 180px; }
  .hero-gauge .pct { font-size: 32px; }
  .heatmap { grid-template-columns: repeat(20, 1fr); }
  .dom-row { grid-template-columns: 100px 1fr 60px; }
}

/* ── responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 64px; padding: 16px 0; }
  .sidebar .brand span:not(.dot), .sidebar nav a span, .sidebar .footer, .sidebar nav .group-label { display: none; }
  .sidebar nav a { justify-content: center; }
  .content { padding: 20px; }
  .topbar { padding: 14px 20px; }
}
@media (max-width: 600px) {
  .login-card { padding: 30px 24px; }
  .stat .value { font-size: 24px; }
}
