:root{
  --bg: #f6f8ff;
  --card: #ffffff;
  --card2: #f3f6ff;
  --text: #111827;
  --muted: #5b6478;
  --line: rgba(17,24,39,.10);
  --accent: #3b82f6;
  --danger: #ef4444;

  --shadow: 0 10px 24px rgba(17,24,39,.08);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", Arial;
  background:
    radial-gradient(900px 520px at 15% 0%, rgba(59,130,246,.16), transparent 60%),
    radial-gradient(800px 480px at 85% 10%, rgba(99,102,241,.10), transparent 60%),
    var(--bg);
  color: var(--text);
}

.wrap{ max-width: 1120px; margin: 0 auto; padding: 18px; }
.muted{ color: var(--muted); }
.small{ font-size: 12px; }
.hidden{ display:none !important; }

.header{ padding-bottom: 8px; }

.brand{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom: 12px;
}
.brand-left{ display:flex; align-items:flex-start; gap:12px; }

.logo{
  width: 44px; height: 44px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(99,102,241,.10));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.logo-img{
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.title{ margin: 4px 0 6px; font-size: 26px; letter-spacing:-0.02em; }
.subtitle{ margin:0; color:var(--muted); line-height:1.4; }

.pill{
  background: rgba(59,130,246,.10);
  border: 1px solid rgba(59,130,246,.18);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 900;
  letter-spacing:.02em;
  box-shadow: var(--shadow);
}

/* Tabs */
.tabs{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  padding: 10px;
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(8px);
}

.tab{
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor:pointer;
  font-weight: 900;
  display:flex; gap:8px; align-items:center;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.tab:hover{ border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.05); }
.tab:active{ transform: translateY(1px); }

.tab.active{
  background: linear-gradient(135deg, rgba(59,130,246,.14), rgba(99,102,241,.10));
  border-color: rgba(59,130,246,.35);
}

.tab-icon-img{
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 6px;
}

.tab-actions{ margin-left:auto; display:flex; gap:10px; flex-wrap:wrap; }

.panel{ margin-top: 16px; }
.panel-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.h2{
  margin:0;
  font-size: 18px;
  display:flex; gap:8px; align-items:center;
}
.h3{
  margin:0;
  font-size: 14px;
  display:flex; gap:8px; align-items:center;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
@media (max-width: 980px){
  .grid2{ grid-template-columns: 1fr; }
  .tab-actions{ width:100%; justify-content:flex-start; margin-left: 0; }
}

/* Card */
.card{
  background: linear-gradient(180deg, rgba(0,0,0,.02), transparent 60%), var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.chip{
  border:1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  color: rgba(17,24,39,.75);
  background: rgba(0,0,0,.03);
}
.chip-row{ display:inline-flex; gap:6px; align-items:center; }
.chip-sep{ opacity:.5; margin: 0 2px; }
.chip-icon-img{ width:14px; height:14px; object-fit:contain; border-radius:4px; }

.infoBox{
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.02);
  padding: 12px;
}
.infoRow{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding: 6px 0;
  align-items: center;
}

.field{ margin: 14px 0; }
.label{ display:block; font-size: 13px; margin-bottom: 6px; }
.hint{ margin:8px 0 0; color: var(--muted); font-size: 12px; line-height:1.45; }

.select,.input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  outline:none;
}
.input-small{
  width: 140px;
  padding: 10px 10px;
}

.select:focus,.input:focus{
  border-color: rgba(59,130,246,.35);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

.divider{ height:1px; background: var(--line); margin: 14px 0; }

.btn-row{ display:flex; gap:10px; flex-wrap:wrap; }
.btn{
  padding: 11px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor:pointer;
  font-weight: 900;
  transition: transform .06s ease, border-color .12s ease, background .12s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover{ background: rgba(59,130,246,.05); border-color: rgba(59,130,246,.35); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(99,102,241,.12));
  border-color: rgba(59,130,246,.35);
}
.btn.ghost{ background: transparent; }
.btn.danger{
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.22);
}

.btn-icon-img{
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 6px;
  flex: 0 0 auto;
}
.btn-ico{
  display:inline-flex;
  width:16px;
  justify-content:center;
}

.h-icon-img{
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 6px;
  margin-right: 6px;
  vertical-align: -3px;
}

.kpis{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.kpi{
  padding: 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.02);
}
.kpi .k{ font-size: 12px; color: var(--muted); }
.kpi .v{ margin-top: 6px; font-size: 22px; font-weight: 1000; letter-spacing:-0.02em; }

.money{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.02);
}
.moneyLine{ display:flex; justify-content:space-between; gap:12px; padding: 6px 0; }

.log{
  padding: 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.02);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ✅ 로그 박스 자체 스크롤 */
.log.log-scroll{
  max-height: 520px;
  overflow: auto;
}

/* 스크롤바 */
.log.log-scroll::-webkit-scrollbar { width: 10px; }
.log.log-scroll::-webkit-scrollbar-track { background: rgba(0,0,0,.04); border-radius: 10px; }
.log.log-scroll::-webkit-scrollbar-thumb { background: rgba(17,24,39,.18); border-radius: 10px; }
.log.log-scroll::-webkit-scrollbar-thumb:hover { background: rgba(17,24,39,.28); }

.summary{
  padding: 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.02);
  overflow:auto;
  line-height: 1.55;
}

.bullets{ margin: 10px 0 0; padding-left: 18px; line-height: 1.75; }

.details{
  margin-top: 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,.02);
}
.details summary{ cursor:pointer; font-weight: 900; }
.details-body{ margin-top: 10px; }

.table{
  border:1px solid var(--line);
  border-radius: 12px;
  overflow:hidden;
  background: #fff;
}
.trow{
  display:grid;
  grid-template-columns: 1.1fr .7fr 1fr .6fr;
}
.trow > div{
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.trow > div:last-child{ border-right: none; }
.thead{ background: rgba(59,130,246,.06); font-weight: 900; }
.trow:last-child > div{ border-bottom: none; }

/* Footer */
.footer{
  color: rgba(17,24,39,.70);
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  padding-bottom: 28px;
  margin-top: 10px;
}