/* 지엔에이 관리자 공통 스타일 — channel 마스터 관리자와 빌더로 만든 사이트 /admin 이 같은 파일을 쓴다 */
:root {
  --ink: #0D1626;
  --ink-2: #172235;
  --ink-3: #24324A;
  --brand: #1E5EFF;
  --brand-600: #174BD6;
  --brand-50: #EDF2FF;
  --signal: #FF7A1A;
  --bg: #F3F5F9;
  --panel: #FFFFFF;
  --line: #E2E7EF;
  --line-2: #EEF1F6;
  --text: #0D1626;
  --muted: #5E6C84;
  --ok: #0E8F47;
  --ok-50: #E6F6EC;
  --warn: #A86500;
  --warn-50: #FFF3DC;
  --err: #CC2F2F;
  --err-50: #FDECEC;
  --radius: 12px;
  --topbar: 60px;
  --sidebar: 240px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); letter-spacing: -0.01em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 로고 ───────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.logo-text small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; opacity: .62; }

/* ── 로그인: 1열 브랜드 · 2열 폼 ───────── */
.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 48px 56px; color: #fff;
  background: radial-gradient(120% 80% at 0% 0%, #22406F 0%, rgba(34,64,111,0) 60%), linear-gradient(160deg, var(--ink-2) 0%, var(--ink) 70%); }
.auth-brand::after { /* 도로 차선 */ content: ''; position: absolute; left: -10%; right: -10%; bottom: 152px; height: 4px; opacity: .35;
  background: repeating-linear-gradient(90deg, #fff 0 46px, transparent 46px 92px); transform: perspective(400px) rotateX(55deg); }
.auth-brand .logo-text b { font-size: 18px; }
.auth-copy { position: relative; z-index: 1; max-width: 520px; }
.auth-kicker { display: inline-block; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.2; letter-spacing: .04em;
  color: var(--signal); background: rgba(255,122,26,.12); border: 1px solid rgba(255,122,26,.35); }
.auth-copy h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.22; font-weight: 800; }
.auth-copy h1 em { font-style: normal; color: #8FB0FF; }
.auth-copy p { margin: 16px 0 0; font-size: 16px; color: rgba(255,255,255,.72); }
.auth-points { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.auth-points li { padding: 14px 16px; border-radius: var(--radius); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.auth-points b { display: block; font-size: 14px; }
.auth-points span { font-size: 12.5px; color: rgba(255,255,255,.6); }
.auth-car { position: absolute; right: -40px; bottom: 132px; width: min(62%, 520px); opacity: .9; z-index: 0; pointer-events: none; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--panel); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; font-weight: 800; }
.auth-card .sub { margin: 8px 0 28px; color: var(--muted); }
.auth-foot { margin-top: 28px; font-size: 12.5px; color: var(--muted); }

/* ── 폼 ───────────────────────────── */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; }
.field small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,94,255,.15); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: 14.5px; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: #C9D2E0; background: var(--line-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; height: 48px; font-size: 15.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid transparent; }
.alert-err { background: var(--err-50); color: var(--err); border-color: #F6CACA; }
.alert-ok { background: var(--ok-50); color: var(--ok); border-color: #BFE6CD; }
.alert-info { background: var(--brand-50); color: var(--brand-600); border-color: #CFDCFF; }

/* ── 로그인 뒤: 헤더 · 사이드 메뉴 · 콘텐츠(폭 100%) ── */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: var(--topbar); padding: 0 20px; background: var(--ink); color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.8); }
.topbar .who .avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink-3); font-weight: 800; font-size: 13px; color: #fff; }
.topbar .btn-out { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); color: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; }
.topbar .btn-out:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.menu-toggle { display: none; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.menu-toggle svg { width: 22px; height: 22px; }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidebar { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 18px 12px; background: var(--panel); border-right: 1px solid var(--line); }
.nav-label { margin: 14px 12px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: #8A97AD; }
.nav-label:first-child { margin-top: 0; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #33415A; font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.on { background: var(--brand-50); color: var(--brand-600); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.sidebar-foot { margin: 22px 12px 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.sidebar-foot b { display: block; margin-top: 2px; color: var(--text); white-space: nowrap; }

.content { width: 100%; min-width: 0; padding: 24px 28px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; font-weight: 800; }
.panel-body { padding: 20px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stat span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.stat b { display: block; margin-top: 4px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #33415A; font-weight: 700; font-size: 13.5px; }
.tabs a:hover { text-decoration: none; border-color: #C9D2E0; }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs a .n { font-size: 12px; opacity: .7; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.search { display: flex; gap: 8px; }
.search .input { height: 36px; width: 240px; }

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 11px 16px; text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); background: #F8F9FC; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFBFD; }
.table .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.table .name b { display: block; font-weight: 700; }
.table .name small { color: var(--muted); font-size: 12.5px; }
.table .dom a { display: block; font-size: 13.5px; }
.table .dom small { color: var(--muted); font-size: 12px; }
.table .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }

/* 상태 칩 — 글자 위아래 여백을 같게: 고정 높이 + line-height 1 + 가운데 정렬 */
.chip { display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.chip-ok { background: var(--ok-50); color: var(--ok); }
.chip-warn { background: var(--warn-50); color: var(--warn); }
.chip-err { background: var(--err-50); color: var(--err); }
.chip-info { background: var(--brand-50); color: var(--brand-600); }
.chip-mute { background: var(--line-2); color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-form > .panel + .panel, .grid-2 > .panel + .panel { margin-top: 0; }

.steps { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.steps li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .dot { flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--muted); }
.steps .ok .dot { background: var(--ok); }
.steps .warning .dot { background: var(--signal); }
.steps .error .dot { background: var(--err); }
.steps .error { color: var(--err); }

.backdrop { display: none; }

@media (max-width: 1080px) {
  .grid-form, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 28px 24px 32px; gap: 24px; }
  .auth-brand::after, .auth-car, .auth-points { display: none; }
  .auth-copy h1 { font-size: 24px; }
  .auth-copy p { font-size: 14.5px; margin-top: 10px; }
  .auth-form { align-items: flex-start; padding: 32px 20px 48px; }

  .menu-toggle { display: inline-grid; place-items: center; margin-left: -8px; }
  .topbar { padding: 0 16px; }
  .topbar .who .name { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; top: var(--topbar); left: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 30px rgba(13,22,38,.18); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: var(--topbar) 0 0 0; z-index: 35; background: rgba(13,22,38,.35); }
  .content { padding: 18px 16px 40px; }
  .search .input { width: 100%; }
  .search { flex: 1; }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 21px; }
  /* 표 → 카드 */
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table.cards td { padding: 4px 0; border: 0; }
  .table.cards td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 64px; margin-right: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
  .table.cards .acts { justify-content: flex-start; margin-top: 8px; }
  .table.cards tr:hover td { background: transparent; }
}
