/* ============================================================
   잇다(ITDA) Partner Console — Design Tokens
   컨셉: 쪽빛(ink) 바탕 + 금실(thread) 액센트, "잇다 = 연결"
   ============================================================ */
:root{
  --ink:        #10182B;
  --ink-2:      #1B2742;
  --ink-3:      #243354;
  --thread:     #D8B15C;
  --thread-dim: #8d7a4e;
  --paper:      #F4F4F0;
  --paper-warm: #FAFAF7;
  --card:       #FFFFFF;
  --line:       #E4E2DA;
  --text:       #232A38;
  --text-sub:   #7C8494;
  --danger:     #C4534A;

  --in:         #2E7D5B;
  --in-bg:      #87DFB7;
  --out:        #B4533C;
  --out-bg:     #EBCDC3;
  --fee:        #3B5FA8;
  --fee-bg:     #EBF0F9;

  --radius:     14px;
  --sidebar-w:  248px;
  --shadow:     0 1px 3px rgba(16,24,43,.06), 0 4px 16px rgba(16,24,43,.05);
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ font-size:15px; }
body{
  font-family:"Pretendard", -apple-system, sans-serif;
  background:var(--paper);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}
a{ text-decoration:none; color:inherit; }
button{ font-family:inherit; cursor:pointer; }
.num{ font-variant-numeric:tabular-nums; letter-spacing:-0.01em; }
.hidden{ display:none !important; }

/* ############################################################
   VIEW 1 — 로그인
   ############################################################ */
#view-login{
  display:grid;
  grid-template-columns: 1.15fr 1fr;
  min-height:100vh;
  background:var(--ink);
}
.brand{
  position:relative;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(216,177,92,.07) 0%, transparent 60%),
    linear-gradient(160deg, var(--ink-2) 0%, var(--ink) 55%);
  color:#EDEBE4;
  display:flex; flex-direction:column; justify-content:space-between;
  padding:56px 64px;
  overflow:hidden;
}
.brand-top{ position:relative; z-index:2; }
.wordmark{ display:flex; align-items:baseline; gap:12px; }
.wordmark .hangul{
  font-family:"Noto Serif KR", serif;
  font-weight:700; font-size:34px; letter-spacing:-0.01em; color:#fff;
}
.wordmark .latin{
  font-size:13px; font-weight:600; letter-spacing:0.32em;
  text-transform:uppercase; color:var(--thread);
}
.brand-mid{ position:relative; z-index:2; }
.tagline{
  font-family:"Noto Serif KR", serif;
  font-weight:600;
  font-size:clamp(26px, 3vw, 40px);
  line-height:1.45; color:#F3F1EA;
}
.tagline em{ font-style:normal; color:var(--thread); }
.tagline-sub{
  margin-top:18px; font-size:15px; line-height:1.7;
  color:#98A0B3; max-width:38ch;
}
.brand-bottom{
  position:relative; z-index:2;
  display:flex; gap:36px;
  font-size:12.5px; color:#6E7789;
}
.brand-bottom b{
  display:block; color:#C9CFDD; font-weight:600;
  margin-bottom:4px; font-size:12px; letter-spacing:0.08em;
}

/* 시그니처: 금실 연결 애니메이션 */
.thread-svg{ position:absolute; inset:0; width:100%; height:100%; z-index:1; opacity:.9; }
.thread-path{
  fill:none; stroke:var(--thread); stroke-width:1.4; stroke-linecap:round;
  stroke-dasharray:1400; stroke-dashoffset:1400;
  animation:draw 3.2s cubic-bezier(.4,0,.2,1) .4s forwards;
  filter:drop-shadow(0 0 6px rgba(216,177,92,.35));
}
.thread-node{
  fill:var(--ink); stroke:var(--thread); stroke-width:1.4;
  opacity:0; animation:pop .5s ease forwards;
}
.thread-node.n1{ animation-delay:.5s; }
.thread-node.n2{ animation-delay:1.6s; }
.thread-node.n3{ animation-delay:2.6s; }
.thread-node.n4{ animation-delay:3.4s; }
.node-label{
  font-family:"Pretendard", sans-serif; font-size:10.5px;
  letter-spacing:0.14em; fill:var(--thread-dim);
  opacity:0; animation:fadein .8s ease forwards;
}
.node-label.l1{ animation-delay:.8s; }
.node-label.l2{ animation-delay:1.9s; }
.node-label.l3{ animation-delay:2.9s; }
.node-label.l4{ animation-delay:3.6s; }
@keyframes draw{ to{ stroke-dashoffset:0; } }
@keyframes pop{ from{ opacity:0; transform:scale(.4);} to{ opacity:1; transform:scale(1);} }
@keyframes fadein{ to{ opacity:1; } }

.login-panel{
  background:var(--paper-warm);
  display:flex; align-items:center; justify-content:center;
  padding:48px 32px;
}
.login-card{ width:100%; max-width:400px; }
.login-head{ margin-bottom:36px; }
.login-eyebrow{
  font-size:12px; font-weight:600; letter-spacing:0.22em;
  color:var(--thread-dim); text-transform:uppercase; margin-bottom:10px;
}
.login-title{ font-size:26px; font-weight:700; letter-spacing:-0.02em; }
.login-desc{ margin-top:8px; font-size:14px; color:var(--text-sub); }

.field{ margin-bottom:16px; }
.field label{
  display:block; font-size:13px; font-weight:600;
  color:var(--text); margin-bottom:8px;
}
.input-wrap{ position:relative; display:flex; align-items:center; }
.input-wrap svg{
  position:absolute; left:16px; width:18px; height:18px;
  stroke:#A6ACB8; pointer-events:none; transition:stroke .2s;
}
.input-wrap input{
  width:100%; height:52px;
  border:1.5px solid var(--line); border-radius:var(--radius);
  background:#fff; padding:0 48px 0 46px;
  font-family:inherit; font-size:15px; color:var(--text);
  transition:border-color .2s, box-shadow .2s;
}
.input-wrap input::placeholder{ color:#B4BAC5; }
.input-wrap input:focus{
  outline:none; border-color:var(--thread);
  box-shadow:0 0 0 4px rgba(216,177,92,.15);
}
.input-wrap:focus-within svg{ stroke:var(--thread-dim); }
.toggle-pw{
  position:absolute; right:8px; width:38px; height:38px;
  border:none; background:none;
  display:flex; align-items:center; justify-content:center;
  border-radius:10px; color:#A6ACB8;
}
.toggle-pw:hover{ background:#F1EFE8; color:var(--text-sub); }
.toggle-pw svg{ position:static; width:19px; height:19px; stroke:currentColor; }
.caps-hint{ display:none; margin-top:8px; font-size:12.5px; color:var(--danger); }
.caps-hint.on{ display:block; }

.btn-login{
  width:100%; height:54px; margin-top:10px;
  border:none; border-radius:var(--radius);
  background:var(--ink); color:#fff;
  font-size:15.5px; font-weight:600; letter-spacing:0.02em;
  position:relative; overflow:hidden;
  transition:background .2s, transform .1s;
}
.btn-login::after{
  content:""; position:absolute; top:0; left:-40%;
  width:40%; height:100%;
  background:linear-gradient(100deg, transparent, rgba(216,177,92,.25), transparent);
  transform:skewX(-18deg); transition:left .45s ease;
}
.btn-login:hover{ background:#1A2440; }
.btn-login:hover::after{ left:110%; }
.btn-login:active{ transform:scale(.985); }
.btn-login:focus-visible{ outline:3px solid var(--thread); outline-offset:2px; }

.login-foot{
  margin-top:28px; padding-top:20px;
  border-top:1px solid var(--line);
  font-size:12.5px; color:var(--text-sub);
  line-height:1.7; text-align:center;
}
.login-foot b{ color:var(--thread-dim); font-weight:600; }

/* ############################################################
   VIEW 2 — 콘솔 (사이드바 + 헤더 + 페이지)
   ############################################################ */
.sidebar{
  position:fixed; top:0; left:0; bottom:0;
  width:var(--sidebar-w);
  background:linear-gradient(175deg, var(--ink-2) 0%, var(--ink) 40%);
  color:#C9CFDD;
  display:flex; flex-direction:column;
  z-index:100;
  transition:transform .25s ease;
}
.sb-logo{ padding:22px 22px 18px; border-bottom:1px solid rgba(216,177,92,.15); }
.sb-logo a{ display:flex; align-items:baseline; gap:9px; }
.sb-logo .hangul{ font-family:"Noto Serif KR", serif; font-weight:700; font-size:22px; color:#fff; }
.sb-logo .latin{
  font-size:10.5px; font-weight:600; letter-spacing:0.28em;
  text-transform:uppercase; color:var(--thread);
}
.sb-profile{
  display:flex; align-items:center; gap:11px;
  padding:16px 22px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.sb-avatar{
  width:36px; height:36px; border-radius:50%;
  background:var(--ink-3); border:1.5px solid var(--thread-dim);
  display:flex; align-items:center; justify-content:center;
  color:var(--thread); font-weight:700; font-size:15px; flex-shrink:0;
}
.sb-profile .who{ flex:1; min-width:0; }
.sb-profile .nick{
  font-size:13.5px; font-weight:600; color:#EDEBE4;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sb-profile .role{ font-size:11px; color:#7C8494; margin-top:2px; }
.sb-logout{
  border:1px solid rgba(255,255,255,.14); background:none; color:#98A0B3;
  font-size:11.5px; padding:5px 10px; border-radius:8px; transition:all .15s;
}
.sb-logout:hover{ border-color:var(--thread); color:var(--thread); }

.sb-nav{ flex:1; overflow-y:auto; padding:14px 12px 24px; }
.sb-nav::-webkit-scrollbar{ width:4px; }
.sb-nav::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.12); border-radius:2px; }
.nav-group{ margin-bottom:6px; }
.nav-group-title{
  display:flex; align-items:center; justify-content:space-between;
  width:100%; padding:9px 10px;
  background:none; border:none;
  font-size:11px; font-weight:600; letter-spacing:0.16em;
  color:var(--thread-dim); text-transform:uppercase;
}
.nav-group-title .chev{ transition:transform .2s; font-size:0; }
.nav-group.closed .chev{ transform:rotate(-90deg); }
.nav-group.closed .nav-items{ display:none; }
.nav-items{ list-style:none; }
.nav-items a{
  display:flex; align-items:center; gap:11px;
  padding:9px 10px; border-radius:10px;
  font-size:13.5px; color:#B8BFCE;
  transition:background .15s, color .15s;
  position:relative;
}
.nav-items a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.nav-items a.active{
  background:rgba(216,177,92,.12); color:var(--thread); font-weight:600;
}
.nav-items a.active::before{
  content:""; position:absolute; left:-12px; top:8px; bottom:8px;
  width:3px; border-radius:0 3px 3px 0; background:var(--thread);
}
.nav-items iconify-icon{ opacity:.85; }

.topbar{
  position:sticky; top:0; z-index:90;
  margin-left:var(--sidebar-w);
  background:rgba(244,244,240,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:14px;
  padding:10px 24px;
}
.hamburger{
  display:none;
  border:1px solid var(--line); background:#fff;
  width:38px; height:38px; border-radius:10px;
  align-items:center; justify-content:center; color:var(--text);
}
.ticker{ display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; flex:1; }
.ticker::-webkit-scrollbar{ display:none; }
.tick{
  display:flex; align-items:center; gap:8px;
  background:#fff; border:1px solid var(--line); border-radius:999px;
  padding:7px 14px; white-space:nowrap; font-size:12.5px;
  box-shadow:0 1px 2px rgba(16,24,43,.03);
}
.tick .k{ color:var(--text-sub); }
.tick .v{ font-weight:700; }
.tick .v.gold{ color:var(--thread-dim); }
.tick .v.blue{ color:var(--fee); }
.tick.warn{ border-color:#EAD3A0; background:#FBF6EA; }
.tick.warn .v{ color:#A2793A; }

.main{
  margin-left:var(--sidebar-w);
  padding:26px 24px 60px;
  max-width:1760px;
}
.page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  flex-wrap:wrap; gap:16px; margin-bottom:22px;
}
.page-head h1{
  font-family:"Noto Serif KR", serif;
  font-size:24px; font-weight:700; letter-spacing:-0.01em;
}
.page-head .crumb{ font-size:12px; color:var(--text-sub); margin-top:5px; }
.page-head .crumb b{ color:var(--thread-dim); font-weight:600; }

.search-form{
  display:flex; align-items:center; gap:8px;
  background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:6px;
  box-shadow:var(--shadow);
}
.search-form input.datepicker{
  border:none; background:none; outline:none;
  width:110px; text-align:center;
  font-family:inherit; font-size:13.5px; color:var(--text);
  padding:6px 2px;
}
.search-form .wave{ color:var(--text-sub); font-size:13px; }
.btn-search{
  border:none; border-radius:9px;
  background:var(--ink); color:#fff;
  font-size:13px; font-weight:600; padding:9px 18px;
  transition:background .15s;
}
.btn-search:hover{ background:var(--ink-3); }

.hero{
  background:linear-gradient(135deg, var(--ink-2) 0%, var(--ink) 70%);
  border-radius:18px; color:#EDEBE4;
  padding:26px 28px; margin-bottom:18px;
  position:relative; overflow:hidden;
  box-shadow:0 6px 24px rgba(16,24,43,.18);
}
.hero::after{
  content:""; position:absolute; right:-30px; top:0; bottom:0; width:340px;
  background:radial-gradient(closest-side at 65% 40%, rgba(216,177,92,.16), transparent 70%);
  pointer-events:none;
}
.hero-grid{
  display:grid; grid-template-columns: 1.4fr repeat(4, 1fr);
  gap:20px; position:relative; z-index:1;
}
.hero-main .lbl{
  font-size:11.5px; font-weight:600; letter-spacing:0.18em;
  text-transform:uppercase; color:var(--thread); margin-bottom:8px;
}
.hero-main .amt{ font-size:34px; font-weight:700; color:#fff; line-height:1.1; }
.hero-main .note{ font-size:12px; color:#8A93A8; margin-top:10px; }
.hero-sub{
  border-left:1px solid rgba(255,255,255,.1);
  padding-left:20px;
  display:flex; flex-direction:column; justify-content:center;
}
.hero-sub .lbl{ font-size:12px; color:#98A0B3; margin-bottom:7px; }
.hero-sub .amt{ font-size:19px; font-weight:700; color:#EDEBE4; }
.hero-sub .amt.gold{ color:var(--thread); }

.section-label{
  font-size:12px; font-weight:600; letter-spacing:0.14em;
  text-transform:uppercase; color:var(--text-sub);
  margin:26px 2px 12px;
  display:flex; align-items:center; gap:10px;
}
.section-label::after{ content:""; flex:1; height:1px; background:var(--line); }
.cards{ display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; }
.card{
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:18px 20px;
  box-shadow:var(--shadow);
  transition:transform .15s, box-shadow .15s;
}
.card:hover{
  transform:translateY(-2px);
  box-shadow:0 4px 8px rgba(16,24,43,.07), 0 10px 28px rgba(16,24,43,.08);
}
.card-head{ display:flex; align-items:center; gap:9px; margin-bottom:14px; }
.card-head .dot{ width:9px; height:9px; border-radius:3px; }
.card-head h3{ font-size:13.5px; font-weight:600; color:var(--text); }
.card-head .badge{
  margin-left:auto; font-size:10.5px; font-weight:700;
  padding:3px 8px; border-radius:999px;
}
.card.in  .dot{ background:var(--in); }
.card.out .dot{ background:var(--out); }
.card.in  .badge{ background:var(--in-bg); color:var(--in); }
.card.out .badge{ background:var(--out-bg); color:var(--out); }
.card .amt{ font-size:22px; font-weight:700; letter-spacing:-0.01em; margin-bottom:10px; }
.card.in  .amt{ color:var(--in); }
.card.out .amt{ color:var(--out); }
.card .meta{
  display:flex; justify-content:space-between;
  font-size:12.5px; color:var(--text-sub);
  padding-top:10px; border-top:1px dashed var(--line);
}
.card .meta b{ color:var(--text); font-weight:600; }

/* ---------- 툴바 (목록 페이지 검색 필터) ---------- */
.toolbar{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:8px;
  box-shadow:var(--shadow);
  margin-bottom:16px;
}
.toolbar .sel{
  border:1px solid var(--line); border-radius:9px;
  background:var(--paper-warm);
  padding:9px 34px 9px 12px;
  font-family:inherit; font-size:13.5px; color:var(--text);
  appearance:none; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237C8494' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center;
}
.toolbar .sel:focus{ outline:none; border-color:var(--thread); }
.toolbar input.datepicker{
  border:1px solid var(--line); border-radius:9px;
  background:var(--paper-warm);
  padding:9px 6px; width:112px; text-align:center;
  font-family:inherit; font-size:13.5px; color:var(--text);
}
.toolbar input.datepicker:focus{ outline:none; border-color:var(--thread); }
.toolbar .wave{ color:var(--text-sub); font-size:13px; padding:0 2px; }
.toolbar .spacer{ flex:1; }
.btn-gold{
  border:none; border-radius:9px;
  background:var(--thread); color:var(--ink);
  font-size:13px; font-weight:700; padding:9px 16px;
  transition:filter .15s;
}
.btn-gold:hover{ filter:brightness(1.06); }

/* ---------- 데이터 테이블 ---------- */
.tablewrap{
  background:#fff; border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:auto;
}
table.data{
  width:100%; border-collapse:collapse;
  font-size:13.5px; min-width:900px;
}
.data thead th{
  background:var(--ink); color:#C9CFDD;
  font-weight:600; font-size:12px; letter-spacing:.05em;
  padding:12px 14px; text-align:left; white-space:nowrap;
  position:sticky; top:0; z-index:1;
}
.data thead th:first-child{ padding-left:18px; }
.data tbody td{
  padding:12px 14px; border-top:1px solid var(--line);
  color:var(--text); white-space:nowrap;
}
.data tbody td:first-child{ padding-left:18px; }
.data tbody tr{ transition:background .12s; }
.data tbody tr:hover{ background:#FBFAF4; }
.data .addr{
  color:var(--text-sub); font-size:12.5px;
  max-width:190px; overflow:hidden; text-overflow:ellipsis;
  display:inline-block; vertical-align:middle;
}
.data .empty td{
  text-align:center; color:var(--text-sub);
  padding:44px 14px; white-space:normal;
}

/* 상태/유형 뱃지 */
.pill{
  display:inline-block;
  font-size:11.5px; font-weight:700;
  padding:4px 11px; border-radius:999px;
  line-height:1.3;
}
.pill.t-charge  { background:var(--in-bg);  color:var(--in); }
.pill.t-exchange{ background:var(--out-bg); color:var(--out); }
.pill.s-request { background:#FBF3DE; color:#A2793A; }
.pill.s-stand   { background:#EEF0F4; color:#5A6478; }
.pill.s-cancel { background:var(--out-bg); color:var(--out); }
.pill.s-complete{ background:var(--in-bg); color:var(--in); }
.pill.s-prepare { background:#F3EDFB; color:#7A5CB0; }
.pill.s-matching{ background:var(--fee-bg); color:var(--fee); }
.pill.s-active  { background:var(--out-bg); color:var(--out); }
.pill.s-inactive{ background:#EEF0F4; color:#5A6478; }

.mo-row textarea{
  width:100%; border:1px solid var(--line); border-radius:9px;
  background:var(--paper-warm); padding:10px 12px;
  font-family:inherit; font-size:13.5px; color:var(--text);
  resize:vertical;
}
.mo-row textarea:focus{ outline:none; border-color:var(--thread); }

/* ===== 정산관리 : 파트너 트리 + 본문 2단 레이아웃 ===== */
.split{ display:grid; grid-template-columns:230px 1fr; gap:16px; align-items:start; }
@media (max-width: 900px){ .split{ grid-template-columns:1fr; } }

.tree-panel{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  padding:14px; box-shadow:0 1px 2px rgba(16,24,43,.04);
}
.tree-panel h5{
  margin:0 0 10px; font-size:12px; font-weight:700;
  color:var(--text-sub); letter-spacing:.08em; text-transform:uppercase;
}
.ptree{ list-style:none; margin:0; padding:0; }
.ptree ul{ list-style:none; margin:0; padding-left:18px; border-left:1px dashed var(--line); margin-left:8px; }
.ptree li{ margin:2px 0; }
.ptree .pnode{
  display:block; padding:7px 10px; border-radius:8px;
  font-size:13.5px; color:var(--text); cursor:pointer;
  transition:background .12s;
}
.ptree .pnode:hover{ background:var(--paper-warm); }
.ptree .pnode.active{
  background:#FBF3DE; color:#7a5f2a; font-weight:700;
  box-shadow:inset 2px 0 0 var(--thread);
}
.ptree .pnode small{ color:var(--text-sub); font-weight:400; margin-left:4px; }

/* ===== 설정(마이페이지) 카드 ===== */
.setcard{ max-width:760px; margin-bottom:16px; }
.setrow{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.setrow .txt{ flex:1; min-width:200px; }
.setrow .setkey{ font-family:'SF Mono', Consolas, monospace; font-size:12.5px; letter-spacing:.02em; }
.sethint{ margin:9px 0 0; font-size:12px; color:var(--text-sub); }

/* ===== 기본 API 문서 ===== */
.api-doc{ max-width:1100px; }
.api-doc h3{ font-size:14.5px; font-weight:700; margin:22px 0 8px; color:var(--text); }
.api-doc p{ color:var(--text-sub); font-size:13.5px; margin:0 0 10px; }
.api-label{
  font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.1em; color:var(--thread-dim); margin:26px 0 6px;
}
.api-doc h2{
  font-size:20px; font-weight:800; margin:0 0 14px; color:var(--text);
  padding-bottom:10px; border-bottom:1px solid var(--line);
}
.api-baseurl{
  background:var(--ink); border-radius:10px; padding:14px 18px;
  display:flex; align-items:center; gap:12px; margin:10px 0 4px;
}
.api-baseurl .tag{
  background:var(--thread); color:var(--ink); font-size:11px; font-weight:800;
  padding:3px 9px; border-radius:5px; flex-shrink:0;
}
.api-baseurl code{ color:#EDE8DC; font-family:'SF Mono', Consolas, monospace; font-size:13px; }
.api-card{
  border:1px solid var(--line); border-radius:12px; overflow:hidden;
  margin-bottom:12px; background:#fff;
}
.api-card-head{
  padding:13px 16px; display:flex; align-items:center; gap:11px;
  cursor:pointer; user-select:none;
}
.api-card-head:hover{ background:var(--paper-warm); }
.api-method{
  font-size:11px; font-weight:800; padding:4px 9px; border-radius:5px;
  font-family:monospace; flex-shrink:0;
  background:var(--fee-bg); color:var(--fee);
}
.api-path{ font-family:'SF Mono', Consolas, monospace; font-size:12.5px; color:var(--text); flex:1; min-width:0; word-break:break-all; }
.api-desc{ font-size:12px; color:var(--text-sub); flex-shrink:0; }
.api-toggle{ color:var(--text-sub); font-size:11px; transition:transform .2s; flex-shrink:0; }
.api-card.open .api-toggle{ transform:rotate(180deg); }
.api-card-body{ display:none; border-top:1px solid var(--line); padding:4px 16px 18px; background:var(--paper-warm); }
.api-card.open .api-card-body{ display:block; }
.api-table{ width:100%; border-collapse:collapse; margin:8px 0; font-size:12.5px; }
.api-table th{
  text-align:left; padding:7px 11px; background:#EFEEE8;
  border:1px solid var(--line); font-weight:700; font-size:10.5px;
  color:var(--text-sub); text-transform:uppercase; letter-spacing:.05em;
}
.api-table td{ padding:8px 11px; border:1px solid var(--line); background:#fff; vertical-align:top; }
.api-pname{ font-family:monospace; color:#3B5FA8; font-size:12px; }
.api-ptype{ font-family:monospace; color:#7A5CB0; font-size:12px; }
.api-req{ display:inline-block; font-size:10px; font-weight:700; padding:1px 7px; border-radius:4px; background:var(--out-bg); color:var(--out); }
.api-opt{ display:inline-block; font-size:10px; font-weight:700; padding:1px 7px; border-radius:4px; background:#EEF0F4; color:#5A6478; }
.api-code{ background:var(--ink); border-radius:10px; overflow:hidden; margin:10px 0; }
.api-code-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 14px; border-bottom:1px solid rgba(255,255,255,.09);
}
.api-code-head span{ font-size:10.5px; color:#8fa0c4; font-weight:700; letter-spacing:.06em; }
.api-copy{
  font-size:11px; color:#c9bd9d; background:none; cursor:pointer;
  border:1px solid rgba(216,177,92,.35); padding:2px 10px; border-radius:5px;
}
.api-copy:hover{ color:var(--thread); border-color:var(--thread); }
.api-code pre{
  margin:0; padding:14px 16px; overflow-x:auto;
  font-family:'SF Mono', Consolas, monospace; font-size:12px; line-height:1.75; color:#E4E0D4;
}
.api-code .k{ color:#9CC4E8; }
.api-code .s{ color:#A9D9A0; }
.api-code .n{ color:#E8B88A; }
.api-authbox{
  border:1px solid var(--line); border-radius:12px; padding:16px 18px;
  background:#fff; margin:10px 0;
}
.api-authbox b{ display:block; font-size:13px; margin-bottom:5px; }
.api-inline{
  font-family:monospace; font-size:12px; background:var(--paper-warm);
  border:1px solid var(--line); padding:1px 7px; border-radius:5px; color:#3B5FA8;
  word-break:break-all;
}

.toolbar input.txt{
  border:1px solid var(--line); border-radius:9px;
  background:var(--paper-warm);
  padding:9px 12px; width:150px;
  font-family:inherit; font-size:13.5px; color:var(--text);
}
.toolbar input.txt:focus{ outline:none; border-color:var(--thread); }
.acct{ line-height:1.45; }
.acct small{ display:block; color:var(--text-sub); font-size:11.5px; }

.btn-mini{
  border:1px solid var(--line); background:#fff;
  border-radius:8px; padding:5px 11px;
  font-size:12px; font-weight:600; color:var(--out);
  transition:all .15s;
}
.btn-mini:hover{ border-color:var(--out); background:var(--out-bg); }

/* ---------- 페이징 ---------- */
.paging{
  list-style:none; display:flex; gap:6px;
  justify-content:center; margin-top:18px; padding:0;
}
.paging a, .paging button, .paging span{
  display:flex; align-items:center; justify-content:center;
  min-width:32px; height:32px; padding:0 8px;
  border:1px solid var(--line); border-radius:8px;
  background:#fff; font-size:13px; color:var(--text-sub);
  cursor:pointer; text-decoration:none;
}
.paging .active a, .paging a.active, .paging a.on, .paging .on a{
  background:var(--ink); color:var(--thread);
  border-color:var(--ink); font-weight:700;
}
.paging a:hover{ border-color:var(--thread-dim); color:var(--text); }

/* ---------- 모달 ---------- */
.mo-overlay{
  position:fixed; inset:0; z-index:300;
  background:rgba(16,24,43,.55);
  backdrop-filter:blur(3px);
  display:none; align-items:center; justify-content:center;
  padding:20px;
}
.mo-overlay.open{ display:flex; }
.mo-card{
  background:#fff; border-radius:18px;
  width:100%; max-width:460px;
  box-shadow:0 20px 60px rgba(16,24,43,.35);
  overflow:hidden;
  animation:pagein .2s ease;
}
.mo-head{
  background:linear-gradient(135deg, var(--ink-2), var(--ink));
  color:#fff; padding:18px 24px;
}
.mo-head .eyebrow{
  font-size:10.5px; font-weight:600; letter-spacing:.22em;
  text-transform:uppercase; color:var(--thread); margin-bottom:4px;
}
.mo-head h4{ font-size:17px; font-weight:700; }
.mo-body{ padding:22px 24px 8px; }
.mo-row{
  display:grid; grid-template-columns:118px 1fr;
  gap:10px; align-items:center; margin-bottom:13px;
}
.mo-row label{ font-size:13px; font-weight:600; color:var(--text); }
.mo-row input, .mo-row select{
  width:100%;
  border:1.5px solid var(--line); border-radius:10px;
  padding:10px 12px;
  font-family:inherit; font-size:14px; color:var(--text);
  background:#fff;
}
.mo-row select{ appearance:none; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237C8494' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center;
}
.mo-row input:focus, .mo-row select:focus{
  outline:none; border-color:var(--thread);
  box-shadow:0 0 0 4px rgba(216,177,92,.14);
}
.mo-row input[readonly]{ background:var(--paper); color:var(--text-sub); }
.mo-hint{
  grid-column:2; font-size:11.5px; color:var(--text-sub); margin-top:-6px;
}
.mo-foot{
  padding:14px 24px 22px;
  display:flex; gap:8px; justify-content:flex-end;
}
.btn-ghost{
  border:1px solid var(--line); background:#fff;
  border-radius:10px; padding:10px 18px;
  font-size:13.5px; font-weight:600; color:var(--text-sub);
}
.btn-ghost:hover{ border-color:var(--text-sub); color:var(--text); }
.btn-ink{
  border:none; border-radius:10px;
  background:var(--ink); color:#fff;
  padding:10px 20px; font-size:13.5px; font-weight:600;
  transition:background .15s;
}
.btn-ink:hover{ background:var(--ink-3); }

@media (max-width:760px){
  .toolbar{ padding:10px; }
  .toolbar .sel{ flex:1; min-width:100px; }
  .toolbar input.datepicker{ width:calc(50% - 20px); }
  .toolbar .spacer{ display:none; }
  .btn-search, .btn-gold{ flex:1; }
  .mo-row{ grid-template-columns:1fr; gap:5px; }
  .mo-hint{ grid-column:1; }
}

/* 준비중 페이지 (카테고리 코드 삽입 대기) */
.placeholder{
  background:var(--card); border:1.5px dashed var(--line);
  border-radius:18px;
  padding:70px 24px;
  text-align:center; color:var(--text-sub);
}
.placeholder iconify-icon{ color:var(--thread-dim); margin-bottom:14px; }
.placeholder h2{ font-size:17px; font-weight:700; color:var(--text); margin-bottom:6px; }
.placeholder p{ font-size:13.5px; line-height:1.7; }

/* SPA 페이지 전환 */
.page{ animation:pagein .25s ease; }
.page.active{ display:block; }
@keyframes pagein{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none;} }

/* 반응형 — 넓은 데스크탑 최적화 */
@media (min-width: 1440px){
  .main{ padding:34px 42px 72px; }
  .page-head{ margin-bottom:26px; }
  .page-head h1{ font-size:27px; }
  .hero{ margin-bottom:18px; }
  .hero-main .amt{ font-size:40px; }
  .hero-sub .amt{ font-size:22px; }
  .cards{ gap:18px; }
  .split{ grid-template-columns:280px 1fr; gap:20px; }
  table.data th, table.data td{ padding:11px 14px; font-size:13.5px; }
  /* 설정 페이지: 카드 2열 배치 */
  #page-member-mypage.active{
    display:grid; grid-template-columns:repeat(2, minmax(0,1fr));
    gap:16px; align-items:start;
  }
  #page-member-mypage .page-head{ grid-column:1 / -1; margin-bottom:8px; }
  #page-member-mypage .setcard{ max-width:none; margin-bottom:0; }
}
@media (min-width: 1800px){
  /* 초광폭: 대시보드 거래카드 한 줄 유지 + 여백 확대 */
  .main{ padding:40px 56px 80px; }
  .cards{ gap:22px; }
  .split{ grid-template-columns:300px 1fr; }
}

/* 반응형 */
@media (max-width: 1100px){
  .hero-grid{ grid-template-columns:1fr 1fr; }
  .hero-main{ grid-column:1 / -1; }
  .hero-sub{ border-left:none; padding-left:0; }
  .cards{ grid-template-columns:repeat(2, 1fr); }
}
@media (max-width: 920px){
  #view-login{ grid-template-columns:1fr; }
  .brand{ padding:40px 28px 48px; min-height:300px; justify-content:flex-start; gap:28px; }
  .brand-bottom{ display:none; }
  .tagline{ font-size:24px; }
  .login-panel{ padding:40px 20px 64px; }
}
@media (max-width: 760px){
  .sidebar{ transform:translateX(-100%); }
  body.sb-open .sidebar{ transform:translateX(0); box-shadow:0 0 60px rgba(0,0,0,.4); }
  .sb-scrim{ display:none; position:fixed; inset:0; z-index:99; background:rgba(16,24,43,.45); }
  body.sb-open .sb-scrim{ display:block; }
  .topbar, .main{ margin-left:0; }
  .hamburger{ display:flex; }
  .cards{ grid-template-columns:1fr; }
  .page-head{ flex-direction:column; align-items:stretch; }
  .search-form{ justify-content:space-between; }
  .hero-main .amt{ font-size:28px; }
}
/* ===== 한손 모바일 최적화 ===== */
.tabbar{ display:none; }
@keyframes sheetup{ from{ transform:translateY(48px); opacity:.5; } to{ transform:none; opacity:1; } }
@media (max-width: 760px){
  /* 하단 탭바: 엄지가 닿는 곳에 핵심 4페이지 + 전체메뉴 */
  .tabbar{
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:95;
    background:rgba(16,24,43,.97); backdrop-filter:blur(10px);
    border-top:1px solid rgba(216,177,92,.28);
    padding:5px 6px calc(5px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    min-height:52px; padding:7px 2px; border:none; background:none;
    color:#8A93A8; font-size:10.5px; font-weight:600;
    text-decoration:none; border-radius:10px; cursor:pointer;
  }
  .tabbar a.on{ color:var(--thread); }
  .tabbar a:active, .tabbar button:active{ background:rgba(255,255,255,.07); }
  .main{ padding-bottom:calc(100px + env(safe-area-inset-bottom)); }

  /* 터치 타깃 확대 + iOS 자동 확대 방지(입력 글자 16px) */
  .txt, .sel{ min-height:44px; font-size:16px; }
  .btn-search, .btn-gold, .btn-ghost, .btn-ink{ min-height:44px; padding:0 16px; font-size:14px; }
  .btn-mini{ min-height:38px; padding:0 14px; }
  .paging a, .paging button, .paging span{ min-width:42px; height:42px; border-radius:10px; font-size:14px; }
  .ptree .pnode{ min-height:44px; display:flex; align-items:center; }

  /* 모달 → 하단 시트: 화면 아래에서 올라와 엄지로 조작 */
  .mo-overlay{ align-items:flex-end; padding:0; }
  .mo-card{
    max-width:none; border-radius:20px 20px 0 0;
    max-height:88vh; overflow-y:auto;
    animation:sheetup .28s cubic-bezier(.2,.8,.3,1);
  }
  .mo-head{ position:relative; padding-top:24px; }
  .mo-head::before{
    content:""; position:absolute; top:9px; left:50%; transform:translateX(-50%);
    width:44px; height:4px; border-radius:2px; background:rgba(255,255,255,.35);
  }
  .mo-foot{
    position:sticky; bottom:0; background:#fff;
    border-top:1px solid var(--line);
    padding:12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .mo-foot .btn-ink, .mo-foot .btn-gold, .mo-foot .btn-search{ flex:1.6; min-height:48px; }
  .mo-foot .btn-ghost{ flex:1; min-height:48px; }
}

@media (prefers-reduced-motion: reduce){
  .thread-path{ animation:none; stroke-dashoffset:0; }
  .thread-node, .node-label{ animation:none; opacity:1; }
  .btn-login::after{ display:none; }
  .page{ animation:none; }
  .mo-card{ animation:none; }
}

/* jQuery UI 데이트피커 톤 */
#ui-datepicker-div{
  font-family:"Pretendard", sans-serif; font-size:13px;
  border:1px solid var(--line); border-radius:12px;
  box-shadow:0 8px 30px rgba(16,24,43,.15);
  padding:10px; z-index:200 !important;
}
.ui-datepicker .ui-datepicker-header{ background:var(--ink); color:#fff; border:none; border-radius:8px; }
.ui-datepicker .ui-state-default{ background:#fff; border:1px solid transparent; text-align:center; border-radius:7px; }
.ui-datepicker .ui-state-active{ background:var(--thread); color:#fff; border-color:var(--thread); }
.ui-datepicker .ui-state-hover{ border-color:var(--thread-dim); }