/* TRADING HACKER 관리자 — 홈페이지와 같은 톤(검정 · 금색 · 빨강).
   틀은 Gloria 관리자 페이지를 따릅니다. */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --paper: #ffffff;
  --ivory: #f6f4ef;
  --panel: #000000;
  --ink: #1a1a1a;
  --ink-2: #5f5f5f;
  --ink-3: #8f8f8f;
  --line: #e6e1d6;
  /* 홈페이지 토큰과 같은 값 (design/tokens.css) */
  --gold-bright: #e7af3e;
  --gold: #ba8e38;
  --gold-deep: #8a6826;
  --gold-soft: #f6ecd6;
  --on-gold: #161615;
  --urgent: #d91a1a;
  --danger: #c62828;
  --ok: #2f8f4e;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.brand {
  font-weight: 800; font-size: 15px; letter-spacing: 0.24em; color: var(--ink);
}
.brand span { color: var(--gold); font-size: 11px; letter-spacing: 0.2em; margin-left: 4px; }

/* ---- 버튼 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}
/* 홈페이지 CTA 와 같은 규칙: 금색 + 어두운 글자, hover 는 진한 금색 + 흰 글자 */
.btn--primary { background: var(--gold-bright); color: var(--on-gold); }
.btn--primary:hover { background: var(--gold-deep); color: #fff; }
.btn--ghost { background: var(--paper); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- 입력 ---- */
.input, select, textarea {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); font-family: inherit; font-size: 13px; color: var(--ink);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus, select:focus, textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft);
}

/* ---- 로그인 ---- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--panel);
}
.loginCard {
  width: 100%; max-width: 360px; background: var(--paper);
  border-radius: 18px; padding: 36px 30px 30px;
  display: grid; gap: 14px; border-top: 4px solid var(--gold-bright);
}
.loginCard h1 { font-size: 20px; font-weight: 600; margin: 6px 0 12px; }
.loginCard label { display: grid; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.loginCard input {
  height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; outline: none;
}
.loginCard input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.loginCard .btn { margin-top: 8px; height: 44px; }
.err { color: var(--danger); font-size: 12.5px; }

/* ---- 상단바 ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px; background: var(--panel); color: #fff;
}
.topbar .brand { color: #fff; }
.tabs { display: flex; gap: 6px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 16px; border: 0; border-radius: 999px;
  background: transparent; color: #c9c9c9; font-size: 13px; font-weight: 600;
}
.tab:hover { color: #fff; }
.tab.is-on { background: var(--gold-bright); color: var(--on-gold); }
/* 미처리(신규) 신청 수 */
.tabBadge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--urgent); color: #fff; font-size: 11px; line-height: 20px; text-align: center;
}
.topbarRight { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.who { font-size: 12px; color: #a8a8a8; }
.topbar .btn--ghost { background: transparent; border-color: #444; color: #d0d0d0; }
.topbar .btn--ghost:hover { border-color: #fff; color: #fff; }

/* ---- 패널 ---- */
.panel { max-width: 1320px; margin: 0 auto; padding: 26px 24px 60px; }
.panelHead {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.panelActions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.panelActions .input--search { width: 260px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.chip.is-on { background: var(--panel); border-color: var(--panel); color: #fff; }
.chip b { font-weight: 700; margin-left: 6px; color: inherit; opacity: .7; }

.notice {
  margin-bottom: 14px; padding: 10px 14px; border-radius: 10px;
  background: #fdf0ee; border: 1px solid #f2cdc8; color: #7d2a20; font-size: 12.5px;
}

/* ---- 표 ---- */
.tableWrap {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top; white-space: nowrap;
}
.table th { background: var(--ivory); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; font-variant-numeric: tabular-nums; }
.table td select { height: 32px; }
.table td .memo { width: 180px; height: 32px; }
.table td.paths { white-space: normal; min-width: 200px; color: var(--ink-2); }
.table td.wrap { white-space: normal; min-width: 160px; }
.table .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--urgent); }
.sub { display: block; font-size: 11.5px; color: var(--ink-3); }
.subtle { color: var(--ink-3); }
.muted { color: var(--ink-3); font-weight: 500; font-size: 11.5px; margin-left: 6px; }
.linkDel { color: var(--ink-3); font-size: 12px; background: none; border: 0; }
.linkDel:hover { color: var(--danger); }

.empty { padding: 40px 0; text-align: center; color: var(--ink-3); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pageInfo { font-size: 12.5px; color: var(--ink-2); }

/* 동의 배지 */
.consent {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: #f1f0ee; color: #5f5c58; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.consent--yes { background: var(--gold-soft); color: var(--gold-deep); }

/* 언어 배지 */
.lang {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  background: var(--ivory); border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 700; color: var(--ink-3);
}

/* ---- 계정 ---- */
.h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.accountCard {
  max-width: 420px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 28px;
}
.accountCard .hint { margin: 0 0 22px; }
.pwForm { display: grid; gap: 14px; }
.pwForm label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pwForm input {
  height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); font-family: inherit; font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.pwForm input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.pwForm .btn { margin-top: 8px; height: 46px; }
.pwMsg { font-size: 12.5px; }
.pwMsg.is-err { color: var(--danger); }
.pwMsg.is-ok { color: var(--ok); }

/* ---- 대시보드 ------------------------------------------------------------- */
.statGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.statCard {
  display: grid; gap: 6px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
}
.statCard--accent { border-color: var(--gold); box-shadow: inset 0 3px 0 var(--gold-bright); }
.statLabel { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-3); }
.statValue {
  font-size: 30px; font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.statSub { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.secTitle { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--ink); }

/* 막대 그래프 — 외부 라이브러리 없이 높이만으로 그립니다.
   값 하나가 막대 하나, 가장 큰 날을 100% 로 잡습니다. */
.chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 160px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 14px 14px 0 0; background: var(--paper);
  overflow-x: auto;
}
.chart .bar { flex: 1 1 auto; min-width: 4px; height: 100%; display: flex; align-items: flex-end; }
.chart .bar span {
  width: 100%; min-height: 2px; /* 0 인 날도 자리를 알 수 있게 */
  border-radius: 3px 3px 0 0; background: var(--gold); transition: background 0.15s;
}
.chart .bar:hover span { background: var(--gold-deep); }
.chart--leads .bar span { background: var(--urgent); }
.chart--leads .bar:hover span { background: #9e1313; }
.chartAxis {
  display: flex; justify-content: space-between; padding: 6px 12px;
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px;
  background: var(--paper); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

.secHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.secHead .secTitle { margin: 0; }
.secHead select { height: 34px; width: auto; }

.dashCols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 36px;
}

/* 기기 · 언어 비율 막대 */
.splitList {
  display: grid; gap: 18px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
}
.split { display: grid; gap: 8px; }
.splitBar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--ivory); }
.splitBar span:first-child { background: var(--gold); }
.splitBar span:last-child { background: #3a3a3a; }
.splitLegend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.splitLegend b { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .panelActions { width: 100%; margin-left: 0; }
  .panelActions .input, .panelActions .input--search { flex: 1 1 160px; width: auto; }
}
