/* ledger-web 화면 공용 모양. 색 이름은 앱(ledger_tool/ledger/screen/web/css/base.css)과 같다 — 빨강은 두지 않고 볼 것은 노랑 계열 하나. */
:root {
  --base: #0b2d5b;
  --accent-line: #9db3d1;
  --accent-soft: #e7edf6;
  --hover: #eef3f9;
  --bg: #f0f3f4;
  --panel: #fff;
  --tint: #f5f7f8;
  --head: #e9edf0;
  --line: #d8dfe2;
  --fg: #18222a;
  --muted: #5a6670;
  --faint: #7d8a95;
  --warn: #8a6100;
  --warn-bg: #fff6dc;
  --ok: #1f7a45;
  --ok-bg: #e3f1e6;
  --tone-blue: #dcebf8;
  --tone-blue-fg: #1f5a94;
  --top-fg: #fff;
  --top-muted: rgba(255, 255, 255, 0.74);
  --r: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.5 "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; display: flex; flex-direction: column; }

/* 남색 띠 + 로고 */
.band { flex: none; height: 48px; background: var(--base); color: var(--top-fg); display: flex; align-items: center; gap: 14px; padding: 0 22px; }
.band .logo { height: 20px; width: auto; display: block; }
.band .sp { flex: 1; }
.band .who { color: var(--top-muted); }
.band a, .band button.lnk { color: var(--top-fg); }
.band .tag { background: rgba(255, 255, 255, 0.14); color: var(--top-fg); }
.main { flex: 1; overflow: auto; }

/* 부품 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input.t, select.t { height: 34px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 10px; font: inherit; color: var(--fg); background: var(--panel); min-width: 0; }
input.t:focus, select.t:focus { outline: 2px solid var(--base); outline-offset: -1px; }
input.t.s, select.t.s { height: 28px; padding: 0 7px; font-size: 12.5px; }
.pw { position: relative; display: flex; }
.pw input { flex: 1; padding-right: 44px; }
.pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; padding: 4px 6px; }
.chk { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.btn { height: 34px; padding: 0 14px; border: 1px solid var(--base); border-radius: var(--r); background: var(--base); color: #fff; font: inherit; font-weight: bold; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.sub { background: var(--panel); color: var(--base); border-color: var(--line); }
.btn.sub:hover { background: var(--hover); }
.btn.big { height: 44px; font-size: 15px; }
.btn.s { height: 26px; padding: 0 9px; font-size: 12px; font-weight: normal; }
.btn:disabled { opacity: .5; cursor: default; }
.lnk { color: var(--base); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: none; }
.lnk:hover { text-decoration: underline; }
.msg { font-size: 12px; min-height: 18px; color: var(--warn); }
.msg.ok { color: var(--ok); }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: normal; line-height: 18px; background: var(--head); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.blue { background: var(--tone-blue); color: var(--tone-blue-fg); }
.tag.dark { background: var(--fg); color: #fff; }
h2.h { font-size: 13px; margin: 0; color: var(--muted); font-weight: bold; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: bold; }
.kv dd .tag { margin-left: 4px; }
table.tb { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
table.tb th { text-align: left; font-weight: normal; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--tint); white-space: nowrap; }
table.tb td { padding: 7px 8px; border-bottom: 1px solid #eef1f3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.tb tr:last-child td { border-bottom: 0; }
table.ptb { table-layout: auto; }
table.ptb th.num { text-align: right; }
table.tb th.ck, table.tb td.ck { text-align: center; }
table.tb td.ck input { width: 15px; height: 15px; margin: 0; accent-color: var(--fg); }
table.tb td.ck.dim input { opacity: .35; }
table.ptb th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.plan-name { font-size: 26px; font-weight: bold; line-height: 1.2; color: var(--fg); }
.toast { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 6px 14px; border-radius: 6px; font-size: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10; }
.toast.on { opacity: .92; }
.dlg { position: fixed; inset: 0; background: rgba(0, 0, 0, .25); display: none; align-items: flex-start; justify-content: center; padding-top: 90px; z-index: 5; }
.dlg.on { display: flex; }
.dlg .card { width: 360px; max-width: calc(100vw - 32px); }
.temp { font-family: Consolas, monospace; background: var(--warn-bg); color: var(--warn); padding: 2px 8px; border-radius: 4px; font-weight: bold; user-select: all; }

/* 로그인 · 앱 열기 */
.center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.center .card { width: 360px; max-width: 100%; }
.center h1 { font-size: 17px; margin: 0 0 4px; }

/* 내 화면 */
.me { max-width: 600px; margin: 24px auto; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.dev { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef1f3; }
.dev:last-child { border-bottom: 0; }
.dev .n { font-weight: bold; }
.dev .s { color: var(--muted); font-size: 12px; }

/* 관리자 */
.adm { padding: 16px 22px 24px; }
.atabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.atabs button { font: inherit; padding: 8px 16px; border: 0; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.atabs button.on { color: var(--base); font-weight: bold; border-bottom-color: var(--base); }
.atabs .n { font-size: 11px; color: var(--faint); margin-left: 3px; font-weight: normal; }
.pane { display: none; }
.pane.on { display: block; }
.mgrid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 14px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.chips button { font: inherit; font-size: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 14px; padding: 1px 10px; cursor: pointer; }
.chips button.on { background: var(--accent-soft); color: var(--base); border-color: var(--accent-line); font-weight: bold; }
.chips b { font-weight: normal; margin-left: 3px; }
.ulist { max-height: 560px; overflow: auto; }
.ulist .u { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.ulist .u:hover { background: var(--hover); }
.ulist .u.pick { background: var(--accent-soft); }
.ulist .u .nm { font-weight: bold; }
.ulist .u .sub { color: var(--muted); font-size: 12px; }
.fields { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.fields > span { color: var(--muted); }
.sect { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }

/* 관리자 · 사용량(상대계정 점검) */
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mon { display: inline-flex; align-items: center; gap: 2px; }
.mon b { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.mon button { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--base); border-radius: var(--r); width: 26px; height: 26px; cursor: pointer; }
.mon button:disabled { opacity: .4; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { font: inherit; font-size: 12px; border: 0; background: var(--panel); color: var(--muted); padding: 0 10px; height: 26px; cursor: pointer; }
.seg button.on { background: var(--accent-soft); color: var(--base); font-weight: bold; }
.fx { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
input.lim { width: 76px; text-align: right; }
input.lim::placeholder { color: var(--faint); }
table.utb th.num { text-align: right; }
table.utb th.srt { cursor: pointer; }
table.utb th.srt.on { color: var(--base); font-weight: bold; }
table.utb tr.clk { cursor: pointer; }
table.utb tr.clk:hover td { background: var(--hover); }
table.utb tr.on td { background: var(--accent-soft); }
table.utb tr.zero td { color: var(--faint); }
table.utb tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: bold; background: var(--tint); }
table.utb tr.open > td { background: var(--tint); padding: 12px 14px 14px; white-space: normal; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.two .card { padding: 10px 12px; }
table.utb td.rate { position: relative; }
table.utb td.rate::before { content: ""; position: absolute; left: 8px; top: 50%; width: 56px; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--head); }
table.utb td.rate i { position: absolute; z-index: 1; left: 8px; top: 50%; height: 6px; margin-top: -3px; width: 0; max-width: 56px; border-radius: 3px; background: var(--accent-line); }
table.utb td.rate span { display: block; padding-left: 64px; font-variant-numeric: tabular-nums; }
table.utb td.rate.hi span, table.utb td.rate.full span { color: var(--warn); font-weight: bold; }
table.utb td.rate.hi i, table.utb td.rate.full i { background: #d9a400; }
table.utb td.rate.full, table.utb tr.on td.rate.full, table.utb tr.clk:hover td.rate.full { background: var(--warn-bg); }

@media (max-width: 760px) {
  .two { grid-template-columns: 1fr; }
  .mgrid { grid-template-columns: 1fr; }
  .band { padding: 0 16px; }
  .adm { padding: 12px 16px; }
}
