/* Envoys Club — 공용 앱 디자인 시스템 (auth + 콘솔 앱셸) */
:root {
  --shell-side: 244px;
  --shell-top: 60px;
  --brand-orange: #ff4d00;
  --brand-orange-hover: #ff621f;
  --bg-dark: #08090b;
  --bg-dark-2: #0c0e12;
  --bg-card: #101318;
  --bg-card-2: #14171d;
  --text-white: #ffffff;
  --text-gray: #8b9098;
  --text-dim: #5b6068;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ok: #2fbd6b;
  --warn: #f5a623;
  --font-suit: "SUIT", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-jp: "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-dark); color: var(--text-white);
  font-family: var(--font-suit); word-break: keep-all;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #23262d; border-radius: 4px; }

/* ── App bar ─────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 100; height: 68px;
  background: rgba(8, 9, 11, 0.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.appbar-wrap {
  width: min(1152px, calc(100% - 48px)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.appbar .logo { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
.appbar .logo span { color: var(--brand-orange); }
.appbar-nav { display: flex; align-items: center; gap: 26px; }
.appbar-nav a { color: var(--text-gray); font-size: 14px; font-weight: 600; transition: color .2s; }
.appbar-nav a:hover, .appbar-nav a.active { color: #fff; }
.appbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-gray); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-orange), #ff8a3d); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; }

/* ── Buttons ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px; border-radius: 9px; font-size: 14.5px; font-weight: 700; border: 1px solid transparent; transition: all .2s; white-space: nowrap; }
.btn-lg { height: 54px; font-size: 15.5px; padding: 0 28px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand-orange); color: #fff; box-shadow: 0 8px 22px rgba(255,77,0,.25); }
.btn-primary:hover { background: var(--brand-orange-hover); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(255,77,0,.4); }
.btn-ghost { background: rgba(255,255,255,.05); color: #fff; border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255,255,255,.09); }
.btn-line { background: transparent; color: var(--text-gray); border-color: var(--border); font-weight: 600; }
.btn-line:hover { color: #fff; border-color: var(--border-strong); }
.btn-sm { height: 40px; font-size: 13.5px; padding: 0 16px; }

/* ── Form fields ─────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 700; color: #fff; }
.field .help { font-size: 12.5px; color: var(--text-gray); line-height: 1.5; margin-top: -2px; }
.input {
  height: 50px; background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 9px; padding: 0 15px; color: #fff; font-size: 14.5px; font-family: inherit; width: 100%; transition: all .25s;
}
.input::placeholder { color: var(--text-dim); }
.input:focus { outline: none; border-color: var(--brand-orange); background: rgba(255,255,255,.05); box-shadow: 0 0 0 4px rgba(255,77,0,.15); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9098' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }
.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-gray); font-size: 13.5px; font-weight: 600; transition: all .2s; }
.chip-toggle.on { border-color: var(--brand-orange); color: #fff; background: rgba(255,77,0,.12); }

/* ── Auth screens ────────────────────────── */
.auth-body { display: flex; flex-direction: column; min-height: 100vh; }
.auth-topbar { height: 68px; display: flex; align-items: center; }
.auth-topbar .wrap { width: min(1152px, calc(100% - 48px)); margin: 0 auto; }
.auth-topbar .logo { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
.auth-topbar .logo span { color: var(--brand-orange); }
.auth-main { flex: 1; display: grid; place-items: center; padding: 40px 24px 80px; position: relative; overflow: hidden; }
.auth-main::before { content: ''; position: absolute; top: -10%; left: 50%; transform: translateX(-50%); width: 700px; height: 700px; background: radial-gradient(circle, rgba(255,77,0,.12), transparent 66%); pointer-events: none; }
.auth-card { position: relative; width: 100%; max-width: 440px; background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 18px; padding: 40px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.auth-eyebrow { color: var(--brand-orange); font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.auth-sub { font-size: 14.5px; color: var(--text-gray); line-height: 1.6; margin-bottom: 30px; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--text-dim); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.social-btns { display: flex; flex-direction: column; gap: 10px; }
.social-btn { height: 50px; border-radius: 9px; border: 1px solid var(--border-strong); background: rgba(255,255,255,.04); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all .2s; }
.social-btn:hover { background: rgba(255,255,255,.08); }
.social-btn.kakao { background: #fee500; color: #191600; border-color: #fee500; }
.social-btn.kakao:hover { background: #ffd900; }
.demo-login { margin-bottom: 24px; }
.demo-login-help { color: var(--text-gray); font-size: 12.5px; line-height: 1.55; margin-top: 10px; }
.demo-preset-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.demo-preset-row .btn { width: 100%; min-width: 0; padding: 0 8px; font-size: 12.5px; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--text-gray); margin-top: 26px; }
.auth-foot a { color: var(--brand-orange); font-weight: 700; }
.field-error { color: #ff5b5b; font-size: 12.5px; margin-top: 6px; display: none; }
.field-error.show { display: block; }

/* ── Workspace ───────────────────────────── */
.ws-main { width: min(1152px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 90px; }
.ws-greeting { margin-bottom: 32px; }
.ws-greeting h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.ws-greeting p { color: var(--text-gray); font-size: 15px; }
.ws-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; margin-bottom: 24px; }
.ws-section-title { font-size: 13px; font-weight: 800; color: var(--brand-orange); margin-bottom: 18px; }

/* status banner */
.status-banner { display: flex; gap: 20px; align-items: flex-start; }
.status-badge { flex-shrink: 0; width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; }
.status-badge svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status-badge.wait { background: rgba(245,166,35,.14); color: var(--warn); }
.status-badge.ok { background: rgba(47,189,107,.14); color: var(--ok); }
.status-badge.no { background: rgba(255,91,91,.14); color: #ff5b5b; }
.status-badge.new { background: rgba(255,77,0,.14); color: var(--brand-orange); }
.status-text h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.status-text p { color: var(--text-gray); font-size: 14.5px; line-height: 1.7; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 800; padding: 5px 12px; border-radius: 100px; margin-bottom: 14px; }
.status-pill.wait { background: rgba(245,166,35,.12); color: var(--warn); }
.status-pill.ok { background: rgba(47,189,107,.12); color: var(--ok); }
.status-pill.no { background: rgba(255,91,91,.12); color: #ff5b5b; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ws-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* meta grid inside application review */
.review-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 20px; }
.review-meta div { background: var(--bg-card); padding: 16px 20px; }
.review-meta dt { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.review-meta dd { font-size: 14.5px; font-weight: 600; }

/* demo control strip */
.demo-strip { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--border); }
.demo-strip .demo-label { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.demo-strip .demo-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* campaign grid (workspace) */
.ws-camp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.ws-camp-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.ws-camp-head p { color: var(--text-gray); font-size: 14px; margin-top: 6px; }
.ws-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.ws-filters button { height: 38px; padding: 0 15px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text-gray); font-size: 13.5px; font-weight: 700; transition: all .2s; }
.ws-filters button.active { background: #fff; color: #08090b; border-color: #fff; }
.camp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.camp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; display: flex; flex-direction: column; transition: all .3s; }
.camp-card:hover { border-color: rgba(255,77,0,.3); transform: translateY(-3px); }
.camp-media { position: relative; aspect-ratio: 16/10; background-size: cover; background-position: center; }
.camp-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,9,11,.5), transparent 55%); }
.camp-chips { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.camp-chips .c { font-size: 11.5px; font-weight: 800; padding: 4px 8px; border-radius: 5px; }
.camp-chips .region { background: rgba(0,0,0,.72); color: #fff; }
.camp-chips .due { background: var(--brand-orange); color: #fff; }
.camp-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.camp-type { align-self: flex-start; font-size: 11.5px; font-weight: 700; color: var(--brand-orange); background: rgba(255,77,0,.1); padding: 4px 8px; border-radius: 5px; margin-bottom: 12px; }
.camp-name { font-size: 17px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.02em; }
.camp-locked { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-gray); padding-top: 12px; border-top: 1px solid var(--border); margin-top: auto; }
.camp-locked svg { width: 13px; height: 13px; stroke: var(--text-gray); fill: none; stroke-width: 2; }
.camp-btn { margin-top: 16px; height: 44px; border-radius: 8px; border: 1px solid var(--border-strong); background: rgba(255,255,255,.05); color: #fff; font-weight: 700; font-size: 13.5px; transition: all .2s; }
.camp-btn:hover { background: var(--brand-orange); border-color: var(--brand-orange); }
.camp-btn.applied { background: rgba(47,189,107,.12); border-color: rgba(47,189,107,.35); color: var(--ok); cursor: default; }
.camp-btn.applied:hover { background: rgba(47,189,107,.12); }

/* ── Dashboard shell (sidebar + panels) ──── */
.dash { display: grid; grid-template-columns: 236px 1fr; gap: 34px; align-items: start; }
.dash-nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 4px; }
.dash-nav .nav-group { font-size: 11.5px; font-weight: 800; color: var(--text-dim); letter-spacing: .04em; padding: 0 16px; margin: 14px 0 8px; }
.dash-nav button { display: flex; align-items: center; gap: 12px; width: 100%; height: 46px; padding: 0 16px; border-radius: 10px; background: transparent; border: none; color: var(--text-gray); font-size: 14.5px; font-weight: 600; text-align: left; transition: all .2s; }
.dash-nav button:hover { background: rgba(255,255,255,.04); color: #fff; }
.dash-nav button.active { background: rgba(255,77,0,.12); color: #fff; }
.dash-nav button .ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--text-gray); }
.dash-nav button.active .ic { color: var(--brand-orange); }
.dash-nav button .lock { margin-left: auto; width: 14px; height: 14px; stroke: var(--text-dim); fill: none; stroke-width: 2; }
.dash-nav button .count { margin-left: auto; font-size: 11.5px; font-weight: 800; background: rgba(255,255,255,.08); color: #fff; min-width: 20px; height: 20px; border-radius: 100px; display: grid; place-items: center; padding: 0 6px; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { margin-bottom: 24px; }
.panel-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.panel-head p { color: var(--text-gray); font-size: 14.5px; line-height: 1.6; }

/* my applications table */
.app-list { display: flex; flex-direction: column; gap: 12px; }
.app-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; }
.app-row .a-name { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; }
.app-row .a-meta { font-size: 13px; color: var(--text-gray); }
.a-status { font-size: 12.5px; font-weight: 800; padding: 6px 13px; border-radius: 100px; white-space: nowrap; }
.a-status.review { background: rgba(245,166,35,.12); color: var(--warn); }
.a-status.picked { background: rgba(47,189,107,.12); color: var(--ok); }
.a-status.closed { background: rgba(255,255,255,.06); color: var(--text-gray); }

/* schedule / profile rows */
.info-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row .k { font-size: 14px; color: var(--text-gray); }
.info-row .v { font-size: 14.5px; font-weight: 600; text-align: right; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-gray); }
.empty-state .es-icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--text-dim); }
.empty-state h3 { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.6; max-width: 380px; margin: 0 auto 20px; }
.gate-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn); background: rgba(245,166,35,.1); padding: 7px 13px; border-radius: 100px; font-weight: 700; }
.gate-lock svg { width: 14px; height: 14px; fill: none; stroke: var(--warn); stroke-width: 2; }

/* mobile dashboard nav */
.dash-nav-mobile { display: none; }

@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; gap: 20px; }
  .dash-nav { display: none; }
  .dash-nav-mobile { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .dash-nav-mobile button { flex-shrink: 0; height: 40px; padding: 0 16px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text-gray); font-size: 13.5px; font-weight: 700; }
  .dash-nav-mobile button.active { background: #fff; color: #08090b; border-color: #fff; }
}

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 2000; background: #16181c; color: #fff; border: 1px solid rgba(255,255,255,.12); border-left: 3px solid var(--brand-orange); padding: 14px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: all .3s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .camp-grid { grid-template-columns: repeat(2, 1fr); }
  .review-meta { grid-template-columns: 1fr; }
  .appbar-nav { display: none; }
}
@media (max-width: 560px) {
  .camp-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 30px 22px; }
  .ws-card { padding: 24px 20px; }
  .status-banner { flex-direction: column; gap: 14px; }
  .user-chip .email { display: none; }
}

/* ══════════════════════════════════════════════════
   공용 앱 셸 (SaaS 사이드바 + 모바일 햄버거 드로어)
   shell.js 와 함께 admin/partner/workspace 콘솔이 공유
   ══════════════════════════════════════════════════ */
.appshell-top {
  position: sticky; top: 0; z-index: 200; height: var(--shell-top);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: rgba(8, 9, 11, 0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.appshell-burger { display: none; width: 38px; height: 38px; border: 1px solid var(--border); background: rgba(255,255,255,.04); border-radius: 9px; align-items: center; justify-content: center; }
.appshell-burger svg { width: 20px; height: 20px; stroke: #fff; }
.appshell-brand { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.appshell-brand span { color: var(--brand-orange); }
.appshell-context { font-size: 12px; font-weight: 800; color: var(--brand-orange); background: rgba(255,77,0,.1); padding: 5px 11px; border-radius: 100px; }
.appshell-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.appshell-body { display: flex; align-items: flex-start; min-height: calc(100vh - var(--shell-top)); }

.appshell-side {
  flex-shrink: 0; width: var(--shell-side); position: sticky; top: var(--shell-top);
  height: calc(100vh - var(--shell-top)); overflow-y: auto;
  border-right: 1px solid var(--border); background: var(--bg-dark);
}
.snav { display: flex; flex-direction: column; gap: 3px; padding: 16px 12px 28px; }
.snav-group { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--text-dim); padding: 0 14px; margin: 16px 0 6px; }
.snav-group:first-child { margin-top: 2px; }
.snav-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 14px; border: none; background: transparent; color: var(--text-gray); font-size: 14.5px; font-weight: 600; text-align: left; border-radius: 10px; transition: all .18s; }
.snav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.snav-item.active { background: rgba(255,77,0,.12); color: #fff; }
.snav-ic { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-gray); }
.snav-item.active .snav-ic { color: var(--brand-orange); }
.snav-item span { flex: 1; min-width: 0; }
.snav-badge { font-size: 11.5px; font-weight: 800; background: rgba(255,255,255,.09); color: #fff; min-width: 20px; height: 20px; border-radius: 100px; display: grid; place-items: center; padding: 0 6px; }

.appshell-main { flex: 1; min-width: 0; padding: 34px 40px 90px; }
.appshell-scrim { display: none; }

/* 콘솔 공통 페이지 헤더/카드 (통일성) */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.page-head p { color: var(--text-gray); font-size: 14.5px; line-height: 1.6; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; }
.stat-card .k { font-size: 13px; color: var(--text-gray); margin-bottom: 10px; }
.stat-card .v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat-card .v.accent { color: var(--brand-orange); }
.stat-card .v.ok { color: var(--ok); }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
/* 클릭 가능한 외부 링크 (채널·레퍼런스·게시물) */
.ext-link { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-orange); font-weight: 600; font-size: 13px; }
.ext-link:hover { text-decoration: underline; }
.ext-link svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }

@media (max-width: 900px) {
  .appshell-main { padding: 22px 18px 80px; }
  .appshell-burger { display: flex; }
  .appshell-side {
    position: fixed; top: var(--shell-top); left: 0; bottom: 0; width: 272px; z-index: 300;
    transform: translateX(-100%); transition: transform .28s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 20px 50px rgba(0,0,0,.5);
  }
  .appshell-side.open { transform: none; }
  .appshell-scrim { display: block; position: fixed; inset: var(--shell-top) 0 0 0; z-index: 250; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .28s; }
  .appshell-scrim.show { opacity: 1; pointer-events: auto; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .appshell-context { display: none; }
  /* actions relocate into the drawer as a stacked footer */
  .appshell-side { display: flex; flex-direction: column; }
  .appshell-side .snav { flex: 0 0 auto; }
  .appshell-side .appshell-actions {
    margin: auto 12px 18px; flex-direction: column; align-items: stretch; gap: 10px;
    padding-top: 16px; border-top: 1px solid var(--border);
  }
  .appshell-side .appshell-actions > * { width: 100%; box-sizing: border-box; }
  .appshell-side .appshell-actions .btn { justify-content: center; }
  .appshell-side .appshell-actions select { width: 100%; }
}
@media (max-width: 520px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 16px; }
  .stat-card .v { font-size: 22px; }
}

/* ── 공용 마스터-디테일 (목록 + 상세) : 데스크톱 2단, 모바일 목록→탭→상세 ── */
.md { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.md-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.md-tools { display: flex; flex-direction: column; gap: 10px; }
.md-count { font-size: 12px; font-weight: 700; color: var(--text-dim); padding: 0 2px; }
.md-scroll { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 220px); overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
.md-scroll::-webkit-scrollbar { width: 6px; }
.md-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.md-item { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 12px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer;
  transition: border-color .15s, background .15s; }
.md-item:hover { border-color: rgba(255,77,0,.35); }
.md-item.active { border-color: var(--brand-orange); background: rgba(255,77,0,.05); }
.md-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--bg-dark-2); flex-shrink: 0; }
.md-thumb.round { border-radius: 50%; }
.md-item-body { min-width: 0; }
.md-item-title { font-size: 14px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-item-sub { font-size: 12px; color: var(--text-gray); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-item-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.md-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.md-detail { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 26px; min-width: 0; }
.md-detail-head { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.md-detail-cover { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--bg-dark-2); }
.md-detail-cover.round { border-radius: 50%; }
.md-back { display: none; }

@media (max-width: 900px) {
  .md { grid-template-columns: 1fr; }
  .md-scroll { max-height: none; overflow: visible; }
  .md > .md-detail { display: none; }
  .md.show-detail > .md-list { display: none; }
  .md.show-detail > .md-detail { display: block; }
  .md-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text-gray);
    border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 800; cursor: pointer; }
  .md-back:hover { color: #fff; }
}
