/* ═══════════════════════════════════════════════════════════
   고고바둑 운영실 — "기원(棋院) 운영실" 테마
   게임 C안(크림+골드+동양판타지)을 운영 콘솔로 번역:
   흑단+금테 사이드바 · 한지 크림 본문 · 바둑판 괘선 텍스처
   ═══════════════════════════════════════════════════════════ */
:root {
  --ebony:      #1b1720;
  --ebony-2:    #262029;
  --gold:       #e2c06e;
  --gold-deep:  #b8923e;
  --cream:      #f6efdf;
  --cream-2:    #fdf9ef;
  --ink:        #3b3247;
  --ink-soft:   #6d6357;
  --lavender:   #9b7fd4;
  --seal:       #c14b41;   /* 낙관 붉은색 — 삭제/경고 */
  --line:       rgba(120, 100, 60, .22);
  --shadow:     0 10px 34px rgba(50, 38, 20, .16);
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }  /* display:grid 등이 hidden 속성을 못 이기게 */
html, body { height: 100%; }
body {
  font-family: "IBM Plex Sans KR", sans-serif;
  color: var(--ink);
  background: var(--cream);
  /* 한지 위 바둑판 괘선 — 아주 옅게 */
  background-image:
    linear-gradient(rgba(140,110,60,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,110,60,.05) 1px, transparent 1px),
    radial-gradient(ellipse at 20% -10%, rgba(226,192,110,.14), transparent 55%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  font-size: 15px;
  line-height: 1.55;
}
h1,h2,h3 { font-family: "Gowun Batang", serif; color: var(--ink); }

/* ── 로그인 게이트 ────────────────────────────── */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: min(440px, 100%); text-align: center;
  background: var(--cream-2);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 52px 40px 44px;
  position: relative; overflow: hidden;
  animation: rise .5s cubic-bezier(.2,.9,.3,1.2) both;
}
.gate-card::before { /* 상단 금띠 */
  content:""; position:absolute; top:0; left:0; right:0; height:5px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-deep), var(--gold), transparent);
}
@keyframes rise { from { opacity:0; transform: translateY(18px);} to { opacity:1; transform:none;} }
.gate-stones { display:flex; justify-content:center; gap:10px; margin-bottom:18px; }
.stone { width: 26px; height: 26px; border-radius: 50%; display:inline-block; box-shadow: inset -3px -4px 6px rgba(0,0,0,.25), 0 3px 6px rgba(0,0,0,.2); }
.stone.black { background: radial-gradient(circle at 34% 30%, #5a5560, #16121c 70%); }
.stone.white { background: radial-gradient(circle at 34% 30%, #ffffff, #d8d2c4 75%); }
.gate-title { font-size: 34px; letter-spacing: .02em; margin-bottom: 8px; }
.gate-title em { font-style: normal; color: var(--gold-deep); }
.gate-sub { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 30px; }
.gate-msg { margin-top: 18px; font-size: 14px; color: var(--seal); min-height: 20px; white-space: pre-line; }

/* ── 버튼 ────────────────────────────────────── */
.btn {
  font-family: inherit; font-size: 15px; font-weight: 600;
  border: none; border-radius: var(--r-md); cursor: pointer;
  padding: 11px 22px; transition: transform .12s, box-shadow .12s, filter .12s;
  white-space: nowrap; /* '확인' 등 짧은 라벨 세로 꺾임 방지 */
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn-gold {
  background: linear-gradient(180deg, #f0d28a, var(--gold) 55%, var(--gold-deep));
  color: #3d2c0d; box-shadow: 0 4px 12px rgba(184,146,62,.4), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-ink { background: var(--ebony-2); color: var(--cream); box-shadow: 0 4px 10px rgba(27,23,32,.3); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-lg { font-size: 17px; padding: 15px 30px; width: 100%; }
.btn-sm { font-size: 13.5px; padding: 8px 14px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ── 레이아웃 ─────────────────────────────────── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background:
    linear-gradient(160deg, rgba(226,192,110,.08), transparent 40%),
    var(--ebony);
  color: #cfc6bb;
  display: flex; flex-direction: column;
  border-right: 2px solid var(--gold-deep);
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px 20px; border-bottom: 1px solid rgba(226,192,110,.25);
}
.brand-stone {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #5a5560, #16121c 70%);
  border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(226,192,110,.45);
}
.side-brand b { font-family: "Gowun Batang", serif; font-size: 19px; color: var(--gold); display: block; line-height: 1.15; }
.side-brand small { font-size: 12px; color: #9d94a8; letter-spacing: .28em; }
.side-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 11px;
  background: none; border: none; text-align: left; cursor: pointer;
  color: #b6adbe; font-family: inherit; font-size: 15px; font-weight: 500;
  padding: 12px 14px; border-radius: var(--r-md);
  transition: background .15s, color .15s;
}
.nav-btn .ico { color: var(--gold-deep); width: 18px; text-align: center; }
.nav-btn:hover { background: rgba(226,192,110,.09); color: var(--cream); }
.nav-btn.active { background: linear-gradient(90deg, rgba(226,192,110,.2), rgba(226,192,110,.06)); color: var(--gold); font-weight: 700; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { padding: 16px 20px 20px; border-top: 1px solid rgba(226,192,110,.25); display: flex; flex-direction: column; gap: 10px; }
.admin-email { font-size: 12px; color: #8d8398; word-break: break-all; }

.main { padding: 34px 40px 60px; max-width: 1240px; }
.view-head { margin-bottom: 24px; }
.view-head h2 { font-size: 30px; }
.view-head p { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }

/* ── 패널·통계 ─────────────────────────────────── */
.panel {
  background: var(--cream-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 24px 26px; margin-bottom: 24px;
}
.panel h3 { font-size: 19px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.two-col { display: grid; grid-template-columns: minmax(380px, 520px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 1000px){ .two-col { grid-template-columns: 1fr; } }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px){ .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content:""; position:absolute; top:0; left:0; right:0; height:3px;
  background: linear-gradient(90deg, var(--gold), transparent); }
.stat small { color: var(--ink-soft); font-size: 13px; }
.stat b { display: block; font-family: "Gowun Batang", serif; font-size: 32px; color: var(--ink); margin-top: 2px; }

/* ── 테이블 ───────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 12.5px;
  letter-spacing: .04em; padding: 8px 10px; border-bottom: 2px solid var(--gold);
  white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr:hover { background: rgba(226,192,110,.10); }
.tbl-click tbody tr { cursor: pointer; }
.tbl .uid { font-size: 12px; color: var(--ink-soft); font-family: ui-monospace, monospace; }
.tbl-more { text-align: center; padding-top: 14px; }
.empty { color: var(--ink-soft); text-align: center; padding: 26px 0 10px; }

.chip { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.chip.guest  { background: rgba(109,99,87,.14); color: var(--ink-soft); }
.chip.google { background: rgba(155,127,212,.18); color: #6b4fa8; }
.chip.apple  { background: rgba(59,50,71,.14); color: var(--ink); }
.chip.on  { background: rgba(46,140,80,.16); color: #22713d; }
.chip.off { background: rgba(193,75,65,.14); color: var(--seal); }

/* ── 폼 ───────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .inp { flex: 1; min-width: 240px; }
.toolbar-note { color: var(--ink-soft); font-size: 13px; }
.inp {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: #fffdf6; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(226,192,110,.25); }
textarea.inp { resize: vertical; }
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.fld-row { display: flex; gap: 12px; }
.fld-row .fld { flex: 1; margin-bottom: 14px; }
.fld-row .btn { align-self: stretch; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 16px; color: var(--ink); }
.chk input { width: 17px; height: 17px; accent-color: var(--gold-deep); }
.hint { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; }
.hint.pad { padding: 0 22px 18px; margin-top: 0; }

.seg { display: inline-flex; background: rgba(120,100,60,.1); border-radius: var(--r-md); padding: 4px; margin-bottom: 18px; }
.seg-btn {
  font-family: inherit; font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  background: transparent; color: var(--ink-soft); border-radius: var(--r-sm); padding: 8px 18px;
}
.seg-btn.active { background: var(--ebony-2); color: var(--gold); box-shadow: 0 2px 6px rgba(27,23,32,.3); }

/* ── 카드 리스트 (공지·발송기록) ─────────────────── */
.card-list { display: flex; flex-direction: column; gap: 12px; max-height: 640px; overflow-y: auto; }
.mini-card {
  border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--r-md); background: #fffdf6; padding: 14px 16px;
}
.mini-card.pinned { border-left-color: var(--seal); }
.mini-card h4 { font-family: "Gowun Batang", serif; font-size: 16px; margin-bottom: 4px; }
.mini-card .meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
.mini-card .body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.mini-card .row-actions { margin-top: 10px; display: flex; gap: 8px; }
.btn-danger { background: none; border: 1px solid rgba(193,75,65,.4); color: var(--seal); }
.btn-danger:hover { background: rgba(193,75,65,.08); }

/* ── 드로어 ───────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-dim { position: absolute; inset: 0; background: rgba(20,14,8,.45); }
.drawer-card {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 92vw);
  background: var(--cream-2); border-left: 2px solid var(--gold-deep);
  box-shadow: -14px 0 40px rgba(30,20,8,.3);
  display: flex; flex-direction: column;
  animation: slidein .28s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 14px; border-bottom: 2px solid var(--gold); }
.drawer-head h3 { font-size: 22px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.kv { display: grid; grid-template-columns: 120px 1fr; font-size: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv b { color: var(--ink-soft); font-weight: 600; }
.kv span { word-break: break-all; }
.drawer-actions { display: flex; gap: 10px; padding: 14px 22px 8px; }

/* ── 토스트 ───────────────────────────────────── */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--ebony); color: var(--gold); font-weight: 600;
  border: 1px solid var(--gold-deep); border-radius: 999px;
  padding: 12px 26px; box-shadow: 0 8px 26px rgba(20,12,4,.4);
  z-index: 99; animation: rise .3s both; font-size: 15px;
}
