/* IXC Payments 운영 콘솔 — 디자인 토큰과 공통 컴포넌트 (docs/console-wireframes.md 와 같이 관리)
   방향(2026-10-21): 밝은 사이드바 + 섹션 라벨, 테두리 카드(그림자 최소), 작은 대문자 표 머리글, 부드러운 상태 pill. 시스템 서체만 쓴다. */
:root {
  --ixc-bg: #f6f7f9;
  --ixc-surface: #ffffff;
  --ixc-sidebar: #ffffff;
  --ixc-sidebar-text: #374151;
  --ixc-text: #111827;
  --ixc-muted: #6b7280;
  --ixc-border: #e5e7eb;
  --ixc-border-soft: #f0f1f3;
  --ixc-primary: #2563eb;
  --ixc-primary-soft: #eef2ff;
  --ixc-primary-text: #1d4ed8;
  --ixc-warning-bg: #fff7e6;
  --ixc-warning-text: #92400e;
  --ixc-radius: 10px;
  --ixc-radius-sm: 6px;
  --ixc-space-1: 4px;
  --ixc-space-2: 8px;
  --ixc-space-3: 16px;
  --ixc-space-4: 24px;
  --ixc-space-5: 32px;
  --ixc-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --ixc-font: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; /* 시스템 서체만. 외부 폰트(CDN)는 싣지 않는다 */
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--ixc-font); font-size: 14px; color: var(--ixc-text); background: var(--ixc-bg); -webkit-font-smoothing: antialiased; }
a { color: var(--ixc-primary-text); }

/* 데모 배너: 항상 맨 위, 얇게 */
.demo-banner { background: var(--ixc-warning-bg); color: var(--ixc-warning-text); border-bottom: 1px solid #fde8b8; text-align: center; padding: 6px var(--ixc-space-3); font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }

/* 레이아웃: 좌측 사이드바 + 본문 */
.layout { display: flex; min-height: calc(100vh - 29px); }
.sidebar { width: 240px; flex: none; background: var(--ixc-sidebar); color: var(--ixc-sidebar-text); border-right: 1px solid var(--ixc-border); padding: 20px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 15px; color: var(--ixc-text); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ixc-primary); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0.02em; }
.brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--ixc-muted); margin-top: 1px; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar .group-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ixc-muted); margin: 14px 10px 6px; }
.sidebar nav a { display: flex; align-items: center; color: var(--ixc-sidebar-text); text-decoration: none; padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; font-size: 14px; }
.sidebar nav a:hover { background: #f3f4f6; }
.sidebar nav a.active { background: var(--ixc-primary-soft); color: var(--ixc-primary-text); font-weight: 600; }
.sidebar .user { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--ixc-border); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; text-transform: uppercase; }
.user-meta { min-width: 0; flex: 1; }
.user-name { font-weight: 600; color: var(--ixc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--ixc-muted); font-size: 12px; }
button.link { background: none; border: none; color: var(--ixc-muted); cursor: pointer; padding: 4px; font: inherit; font-size: 12px; }
button.link:hover { color: var(--ixc-text); text-decoration: underline; }

.content { flex: 1; min-width: 0; padding: 28px 32px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ixc-space-3); margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.page-sub { color: var(--ixc-muted); font-size: 13px; margin: 4px 0 0; }

/* 카드·패널 */
.card, .panel, .kpi { background: var(--ixc-surface); border: 1px solid var(--ixc-border); border-radius: var(--ixc-radius); box-shadow: var(--ixc-shadow); }
.panel { padding: 18px 20px; margin-bottom: var(--ixc-space-3); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel h2 { font-size: 15px; font-weight: 600; margin: 0; }
.panel-link { font-size: 13px; color: var(--ixc-primary-text); text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ixc-space-3); }
.two-col .panel { margin-bottom: var(--ixc-space-3); }

/* KPI 타일 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--ixc-space-3); margin-bottom: var(--ixc-space-3); }
.kpi { padding: 16px 18px; }
.kpi-label { color: var(--ixc-muted); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--ixc-muted); margin-left: 3px; }
.kpi-sub { color: var(--ixc-muted); font-size: 12px; margin-top: 4px; }
.kpis.ops { grid-template-columns: repeat(3, 1fr); }
.kpi.attention { border-color: #fde8b8; background: var(--ixc-warning-bg); }
/* 거래 조회(D4): 조건 바 · 페이지 · 상세 키-값 · 접힌 JSON */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ixc-muted); }
.filters label.grow { flex: 1 1 240px; }
.filters .hidden { display: none; }
.panel-head.pad { padding: 14px 16px 0; }
.pager { display: flex; gap: 14px; justify-content: center; align-items: center; padding: 12px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--ixc-muted); }
.kv dd { margin: 0; }
.panel > details { margin-top: 10px; }
details summary { cursor: pointer; }
pre.json { margin: 6px 0 0; padding: 10px; max-height: 260px; overflow: auto; font-size: 12px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; white-space: pre-wrap; word-break: break-all; }
.kpi.attention .kpi-value { color: var(--ixc-warning-text); }

/* 표 */
table { width: 100%; border-collapse: collapse; background: var(--ixc-surface); }
.table-card { padding: 0; overflow: hidden; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ixc-muted); padding: 10px 12px; border-bottom: 1px solid var(--ixc-border); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--ixc-border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #374151; }
.muted { color: var(--ixc-muted); }
.small { font-size: 12px; }
.empty { color: var(--ixc-muted); padding: 18px 12px; text-align: center; }

/* 상태 pill: ok=승인·검증, warn=실패·거부·만료, p1=우선·강조, p2=중립 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.tag.ok { background: #dcfce7; color: #166534; }
.tag.warn { background: #fee2e2; color: #991b1b; }
.tag.p1 { background: #dbeafe; color: #1e40af; }
.tag.p2 { background: #f3f4f6; color: #374151; }
.tag.pend { background: #fef3c7; color: #92400e; }

/* 알림·버튼·폼 */
.alert { padding: 10px 12px; border-radius: 8px; margin-top: var(--ixc-space-3); font-size: 13px; border: 1px solid transparent; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
button.primary, a.button { display: inline-block; padding: 10px 16px; background: var(--ixc-primary); color: #fff; border: none; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button.primary:hover, a.button:hover { background: var(--ixc-primary-text); }
label { display: block; margin-top: 14px; font-size: 13px; font-weight: 500; color: #374151; }
input[type=text], input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--ixc-border); border-radius: 8px; font: inherit; margin-top: 6px; background: #fff; }
input:focus { outline: none; border-color: var(--ixc-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* 작은 버튼·인라인 폼·선택 상자(계정 관리 등) */
.btn-sm { white-space: nowrap; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 600; color: #374151; background: #fff; border: 1px solid var(--ixc-border); border-radius: var(--ixc-radius-sm); cursor: pointer; }
.btn-sm:hover { background: #f3f4f6; }
.btn-sm.danger { color: #991b1b; border-color: #fecaca; }
.btn-sm.danger:hover { background: #fef2f2; }
form.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 4px 0; }
.input-sm, .select-sm { padding: 5px 8px; font: inherit; font-size: 12px; border: 1px solid var(--ixc-border); border-radius: var(--ixc-radius-sm); background: #fff; }
.input-sm { width: 170px; }
td.actions, td.nowrap { white-space: nowrap; }
select { padding: 10px 12px; border: 1px solid var(--ixc-border); border-radius: 8px; font: inherit; margin-top: 6px; background: #fff; width: 100%; }
.form-row { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr 1.2fr auto; gap: var(--ixc-space-3); align-items: end; }
.form-row label { margin-top: 0; }
.form-submit { padding-bottom: 1px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ixc-muted); margin-top: 12px; }
label.check input { width: auto; margin: 0; }

/* 로그인 */
.login-body { background: var(--ixc-bg); }
.login-wrap { min-height: calc(100vh - 29px); display: flex; align-items: flex-start; justify-content: center; padding: 72px var(--ixc-space-3); }
.login-card { width: 400px; padding: 32px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; text-align: center; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.login-brand h1 { font-size: 18px; margin: 0; }
.login-card button.primary { width: 100%; margin-top: 20px; padding: 11px; }
.login-help { margin: 16px 0 0; text-align: center; }

/* 빈 상태·오류 */
.empty-state { max-width: 480px; margin: 48px auto; padding: 32px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; font-size: 18px; }
.empty-state p { color: var(--ixc-muted); margin: 0 0 20px; }

@media (max-width: 900px) {
  .kpis, .two-col { grid-template-columns: 1fr 1fr; }
  .sidebar { width: 200px; }
  .content { padding: 20px; }
}
