/* =====================================================================
   관리자 백오피스 전용 스타일
   tokens.css → base.css → admin.css
   ===================================================================== */

/* ---------- 로그인 ---------- */
.admin-login {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 24px; min-height: 100dvh; background: var(--bg);
}
.admin-login.is-off { display: none; }
.al-card {
  width: min(390px, 100%); background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 28px 26px 24px;
}
.al-card .logo { margin: 0 auto var(--sp-4); }
.al-title { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-bottom: 5px; }
.al-sub { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin: 0 0 var(--sp-5); line-height: 1.5; }
.al-card .btn { width: 100%; margin-top: 4px; }
.al-note { font-size: 11px; color: var(--ink-faint); text-align: center; margin-top: 13px; line-height: 1.6; }
.al-secure {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: var(--ink-faint);
  border-top: 1px solid var(--line); margin-top: var(--sp-4); padding-top: 13px;
}
.al-secure svg { width: 13px; height: 13px; color: var(--admin); flex-shrink: 0; }

/* ---------- 레이아웃 ---------- */
.admin-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.admin-shell.is-off { display: none; }
@media (max-width: 760px) { .admin-shell { grid-template-columns: 1fr; } }

.side {
  background: var(--bg-alt); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
}
@media (max-width: 760px) {
  .side { border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; padding: 10px 12px; }
}
.side-brand { padding: 4px 12px 16px; }
.side-brand .logo { width: 132px; height: 17.4px; }
.side-user { font-size: 11.5px; color: var(--ink-faint); padding: 0 12px 14px; display: flex; align-items: center; gap: 8px; }
.side-user .avatar {
  width: 26px; height: 26px; border-radius: 8px; background: var(--admin); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; flex-shrink: 0;
}
@media (max-width: 760px) { .side-brand, .side-user { display: none; } }
.nav-btn {
  text-align: left; background: none; border: none; font-family: var(--font-body); font-size: 13.5px;
  color: var(--ink-soft); padding: 10px 12px; border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
}
.nav-btn:hover { background: var(--paper); }
.nav-btn:focus-visible { outline: 2px solid var(--admin); outline-offset: 1px; }
.nav-btn.is-on { background: var(--admin); color: #fff; font-weight: 600; }
.nav-btn .dotix { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex-shrink: 0; }
.nav-logout { margin-top: auto; }
@media (max-width: 760px) { .nav-logout { margin-top: 0; } }

.main { padding: 26px 28px 40px; overflow-x: auto; background: var(--bg); }
.panel { display: none; }
.panel.is-on { display: block; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.panel > h2 { margin-bottom: 4px; }

/* ---------- 통계 타일 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: 18px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: var(--sp-4); }
.stat-tile .lbl { font-size: 11.5px; color: var(--ink-soft); margin-bottom: 6px; }
.stat-tile .val { font-family: var(--font-mono); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.stat-tile .delta { font-size: 11px; color: var(--ok); margin-top: 4px; }
.stat-tile .delta.down { color: var(--danger); }

.spark { display: flex; align-items: flex-end; gap: 6px; height: 74px; }
.spark i { flex: 1; background: var(--admin); opacity: .75; border-radius: 5px 5px 0 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); flex-wrap: wrap; gap: 10px; }
.toolbar .btn { width: auto; }

/* ---------- 상품 카드 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-5); }
@media (max-width: 860px) { .product-grid { grid-template-columns: 1fr; } }
.product-card {
  border: 1px solid var(--line); border-radius: 14px; padding: var(--sp-4) var(--sp-4) 13px;
  background: var(--paper); display: flex; flex-direction: column;
}
.product-card.is-top { border-color: var(--admin); box-shadow: 0 0 0 3px var(--admin-soft); }
.product-card .tier {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  color: var(--admin); text-transform: uppercase; margin-bottom: 7px;
}
.product-card .pname { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.product-card .price { font-family: var(--font-mono); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.product-card .price small { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-left: 3px; }
.product-card .pdesc { font-size: 11.5px; color: var(--ink-soft); line-height: 1.6; margin-top: var(--sp-2); }
.product-card .prow {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--ink-soft);
  border-top: 1px solid var(--line); padding-top: 9px; margin-top: var(--sp-3);
}
.product-card .prow .num { font-weight: 600; color: var(--ink); }

/* ---------- 발급 결과 카드 ---------- */
.issue-card {
  border: 1px solid var(--admin); background: var(--admin-soft); border-radius: 14px;
  padding: var(--sp-4) 18px; margin-bottom: var(--sp-6); display: none; gap: 18px; align-items: flex-start;
}
.issue-card.is-on { display: flex; flex-wrap: wrap; }
.issue-qr { background: #fff; border-radius: var(--radius-box); padding: 9px; flex-shrink: 0; }
.issue-body { flex: 1; min-width: 230px; }
.issue-title { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.issue-title .tick {
  width: 18px; height: 18px; border-radius: 50%; background: var(--admin); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.issue-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.issue-row:last-of-type { border-bottom: none; }
.issue-row span:first-child { color: var(--ink-soft); white-space: nowrap; }
.issue-row span:last-child  { font-family: var(--font-mono); font-weight: 600; text-align: right; word-break: break-all; }
.issue-note { font-size: 11.5px; color: var(--ink-soft); line-height: 1.6; margin: 10px 0 0; }

/* ---------- 목록 셀 ---------- */
.pw-cell { font-family: var(--font-mono); font-size: 12px; }
.pw-cell small { display: block; color: var(--ink-faint); font-size: 10.5px; font-family: var(--font-body); }
.status-btn {
  border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--radius-pill);
  padding: 4px 11px; font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); color: var(--ink-soft); white-space: nowrap;
}
.status-btn.is-settled { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.status-btn.is-open    { background: var(--danger-bg); border-color: transparent; color: var(--danger); }

/* ---------- 모달 상세 ---------- */
.modal-code { font-family: var(--font-mono); font-size: 12px; color: var(--admin); font-weight: 600; }
.modal-top { display: flex; gap: var(--sp-4); align-items: flex-start; margin-bottom: var(--sp-4); flex-wrap: wrap; }
.modal-qr { background: #fff; border-radius: var(--radius-box); padding: 9px; flex-shrink: 0; }
.modal-msg {
  background: var(--admin-soft); border-radius: 11px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.6; color: var(--ink); margin-bottom: var(--sp-4);
}
.modal-msg b {
  display: block; font-size: 11px; color: var(--admin);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px;
}
