/* LikeLive 셀러 콘솔. 브랜드 색은 static/img/README.md 와 같습니다. */
:root {
  --brand: #ff4d4f;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --bg: #fafafa;
  --ok: #10b981;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.6 -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; }

/* ── 상단바 ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.who { color: var(--muted); }

.wrap { max-width: 920px; margin: 0 auto; padding: 28px 20px 60px; }

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 6px; }
.muted { color: var(--muted); font-size: 14px; }

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

/* ── 폼 ─────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 14px; }
.form { max-width: 460px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input, textarea {
  font: inherit; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.row { display: flex; align-items: center; gap: 14px; }

button, .primary {
  font: inherit; cursor: pointer;
  padding: 9px 15px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff;
}
button:hover { border-color: var(--muted); }
.primary {
  background: var(--brand); color: #fff; border-color: var(--brand);
  text-decoration: none; font-weight: 600; display: inline-block;
}
.primary:hover { filter: brightness(0.94); }
.danger:hover { border-color: var(--brand); color: var(--brand); }
.link { border: none; background: none; padding: 0; color: var(--muted); text-decoration: underline; }
.inline { display: inline; }

/* ── 로그인 ─────────────────────────────────────────── */
.auth {
  max-width: 340px; margin: 60px auto; padding: 28px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center;
}
.auth h1 { font-size: 18px; }
.auth .stack { text-align: left; margin-top: 18px; }
.auth-logo { margin-bottom: 10px; }

.alert {
  background: #fff1f0; border: 1px solid #ffccc7; color: #a8071a;
  padding: 10px 12px; border-radius: 7px; font-size: 14px; margin: 0 0 4px;
}

/* ── 목록 ───────────────────────────────────────────── */
.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.grid th, .grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.grid th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fcfcfc; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .zero { color: var(--brand); font-weight: 700; }
.grid .thumb img { border-radius: 6px; object-fit: cover; display: block; }
.grid .actions { display: flex; gap: 6px; align-items: center; }
.grid .actions button { padding: 5px 9px; font-size: 13px; }
.grid .actions input { padding: 5px 7px; font-size: 13px; }

.badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f4f4f5; }
.badge.s-active { background: #e7f8f0; color: #067a52; }
.badge.s-sold_out { background: #fff1f0; color: #a8071a; }

/* ── 빈 상태 ────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; }
.empty img { opacity: 0.9; margin-bottom: 8px; max-width: 100%; height: auto; }
.empty p { color: var(--muted); margin: 8px 0 18px; }

/* ── 콘솔 카드 ──────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.card {
  padding: 18px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none;
}
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.card:not(.disabled):hover { border-color: var(--brand); }
.card.disabled { opacity: 0.55; }

@media (max-width: 640px) {
  .grid .actions { flex-wrap: wrap; }
  .topbar { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ── 시청 페이지 ─────────────────────────────────────── */
.watch { background: #fff; }
.watch-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.watch-wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 60px; }
.watch-title { font-size: 20px; margin: 4px 0 14px; }

.live-badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: #f4f4f5; color: var(--muted); letter-spacing: 0.04em;
}
.live-badge.on { background: var(--brand); color: #fff; }

.player {
  position: relative; aspect-ratio: 16 / 9; background: #18181b;
  border-radius: 10px; overflow: hidden;
}
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-placeholder { width: 100%; height: 100%; object-fit: cover; display: block; }

.products { margin-top: 24px; }
.products h2 { font-size: 15px; color: var(--muted); margin-bottom: 12px; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pcard {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
  /* 푸시된 카드가 등장할 때 눈에 띄게. 라이브에서는 이게 구매 전환을 만듭니다. */
  animation: pop 0.35s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pcard { animation: none; } }

.pcard img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pcard-body { padding: 10px 11px 12px; }
.pcard h3 { font-size: 14px; margin: 0 0 4px; font-weight: 600; }
.pcard .price { margin: 0 0 9px; font-weight: 700; }
.pcard.sold { opacity: 0.55; }

.buy {
  display: block; text-align: center; padding: 8px; border-radius: 7px;
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
}
.buy.disabled { background: #e4e4e7; color: var(--muted); pointer-events: none; }

/* ── 방송 콘솔 ──────────────────────────────────────── */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 18px;
}
.panel h2 { font-size: 15px; }
.grid tr.pushed { background: #fff7f7; }
select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.badge.s-live { background: var(--brand); color: #fff; }
.badge.s-ended { background: #f4f4f5; color: var(--muted); }

/* ── 주문 ───────────────────────────────────────────── */
.order-item { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.order-item img { border-radius: 8px; object-fit: cover; }
.order-item h2 { margin: 0 0 3px; font-size: 16px; }
.order-item .price { margin: 0 0 2px; font-weight: 700; }

.summary { width: 100%; border-collapse: collapse; margin: 12px 0; }
.summary th, .summary td { padding: 7px 0; text-align: left; font-weight: 400; vertical-align: top; }
.summary th { color: var(--muted); font-size: 14px; width: 40%; }
.summary td { text-align: right; }
.summary tr.total th, .summary tr.total td {
  border-top: 1px solid var(--line); font-weight: 700; padding-top: 10px;
}
.badge.s-pending { background: #fff7e6; color: #ad6800; }
.badge.s-paid { background: #e7f8f0; color: #067a52; }
.badge.s-shipped { background: #e6f4ff; color: #0958d9; }
.badge.s-completed { background: #f4f4f5; color: var(--ink); }
.badge.s-cancelled, .badge.s-refunded { background: #fff1f0; color: #a8071a; }
