:root {
  --navy: #15233f;
  --navy-soft: #1c2d4f;
  --blue: #2f6bff;
  --blue-deep: #1f5ef0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #7b8491;
  --line: #e6ebf2;
  --shadow: 0 8px 24px rgba(28, 55, 90, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

button {
  font-family: inherit;
}

.admin {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #13233f 0%, #101b33 100%);
  color: #d7deea;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
}

.sidebar__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px 10px;
}

.sidebar__brand strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #fff;
}

.sidebar__brand span {
  font-size: 12px;
  font-weight: 700;
  color: #7ea2ff;
  letter-spacing: 0.04em;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item,
.nav-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: #c5cede;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.nav-item svg,
.nav-group summary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover,
.nav-group summary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.is-active {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.nav-group summary {
  list-style: none;
  justify-content: space-between;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-group .chev {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  transition: transform 0.15s;
}

.nav-group[open] .chev {
  transform: rotate(180deg);
}

.nav-group a {
  display: block;
  margin: 2px 0 2px 28px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #9aa7bd;
}

.nav-group a:hover,
.nav-group a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar__foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.sidebar__note {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 14px 12px;
}

.sidebar__home {
  flex-shrink: 0;
  width: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 6px 7px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.sidebar__home svg {
  width: 18px;
  height: 18px;
}

.sidebar__home:hover {
  background: var(--blue-deep);
  color: #fff;
}

.sidebar__note strong {
  display: block;
  color: #fff;
  font-size: 14px;
  margin-bottom: 4px;
}

.sidebar__note p {
  margin: 0;
  font-size: 12px;
  color: #9aa7bd;
  line-height: 1.45;
}

.admin__main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 8px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar time {
  font-size: 13px;
  color: #6b7480;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
}

.admin-user__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e8efff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
}

.admin-user strong {
  display: block;
  font-size: 13.5px;
  line-height: 1.2;
}

.admin-user small {
  color: var(--muted);
  font-size: 11.5px;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.dashboard {
  padding: 12px 28px 32px;
  display: grid;
  gap: 16px;
}

.dashboard[hidden] {
  display: none !important;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 98px;
}

.stat-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-card__icon svg {
  width: 18px;
  height: 18px;
}

.stat-card__icon--blue {
  background: #e8f0ff;
  color: #3b7cff;
}

.stat-card__icon--violet {
  background: #eee8ff;
  color: #7a5af8;
}

.stat-card__icon--cyan {
  background: #e6f7f4;
  color: #1aa88e;
}

.stat-card__icon--green {
  background: #e8f6ec;
  color: #2f9e57;
}

.stat-card__icon--orange {
  background: #fff1e6;
  color: #f0842a;
}

.stat-card__icon--pink {
  background: #ffe8f0;
  color: #e25a8b;
}

.stat-card__label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.stat-card strong span {
  font-size: 12px;
  font-weight: 600;
  margin-left: 2px;
  color: #6b7480;
}

.stat-card strong.danger {
  color: #e11d48;
}

.stat-card em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11.5px;
}

.stat-card em.up {
  color: #16a34a;
}

.stat-card em.warn {
  color: #e11d48;
}

.stat-card em.mute {
  color: #9aa3af;
}

.mid-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.85fr) minmax(220px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
}

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

.panel__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.panel__head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.panel__head p strong {
  color: var(--blue);
}

.more {
  font-size: 12.5px;
  color: var(--muted);
}

.more:hover {
  color: var(--blue);
}

.seg {
  display: inline-flex;
  background: #f1f4f9;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.seg button {
  border: 0;
  background: transparent;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: #6b7480;
  cursor: pointer;
  font-weight: 600;
}

.seg button.is-on {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(28, 55, 90, 0.08);
}

.chart-wrap {
  position: relative;
  height: 240px;
}

.chart-empty {
  margin: 0;
  height: 100%;
  display: grid;
  place-items: center;
  color: #8b93a0;
  font-size: 13.5px;
  text-align: center;
}

.panel-empty {
  display: block;
  grid-column: 1 / -1;
  padding: 28px 8px;
  text-align: center;
  color: #8b93a0;
  font-size: 13.5px;
  font-weight: 600;
  border: 0;
}

.rank-list .panel-empty,
.qa-wait .panel-empty,
.member-list .panel-empty {
  display: block;
  border-top: 0;
  padding: 28px 8px;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-list li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #f1f4f8;
}

.rank-list li:first-child {
  border-top: 0;
}

.rank-list span {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #eef2f8;
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.rank-list li:nth-child(-n + 3) span {
  background: #e8f0ff;
  color: var(--blue);
}

.rank-list strong {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.rank-list em {
  font-style: normal;
  font-size: 12.5px;
  color: #8b93a0;
  font-variant-numeric: tabular-nums;
}

.qa-wait,
.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qa-wait li,
.member-list li {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid #f1f4f8;
}

.qa-wait li:first-child,
.member-list li:first-child {
  border-top: 0;
  padding-top: 2px;
}

.qa-wait li {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.qa-wait strong {
  display: block;
  font-size: 13.5px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qa-wait small,
.member-list small,
.member-list time {
  color: #93a0ae;
  font-size: 12px;
}

.qa-wait button {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.qa-wait button:hover {
  background: var(--blue-deep);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.tag--blue {
  background: #e8f0ff;
  color: #3b7cff;
}

.tag--green {
  background: #e8f6ec;
  color: #2f9e57;
}

.tag--orange {
  background: #fff1e6;
  color: #f0842a;
}

.tag--violet {
  background: #eee8ff;
  color: #7a5af8;
}

.member-list li {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.member-list strong {
  display: block;
  font-size: 13.5px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.av-1 {
  background: #5b8cff;
}

.av-2 {
  background: #34b27b;
}

.av-3 {
  background: #8b5cf6;
}

.av-4 {
  background: #f0842a;
}

.av-5 {
  background: #e25a8b;
}

.side-stack {
  display: grid;
  gap: 14px;
}

.promo {
  background: linear-gradient(145deg, #2f6bff 0%, #1f5ef0 55%, #4f7fff 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.28);
}

.promo p {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.4;
}

.promo a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 12.5px;
  font-weight: 700;
}

.promo a:hover {
  background: rgba(255, 255, 255, 0.28);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-grid a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #334155;
  background: #fbfcfe;
}

.quick-grid a:hover {
  border-color: #c9d8f3;
  color: var(--blue);
  background: #f5f8ff;
}

.quick-grid svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1199px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .side-stack {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1.2fr;
  }
}

@media (max-width: 767px) {
  .admin {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    width: 260px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 30;
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .sidebar-toggle {
    display: inline-grid;
    place-items: center;
  }

  .mid-grid,
  .bottom-grid,
  .side-stack {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .qa-wait li {
    grid-template-columns: auto 1fr;
  }

  .qa-wait button {
    grid-column: 2;
    justify-self: start;
  }
}
