/* Smart LH Bid — Lynn Standard 디자인 체계(흰 상단바·주황 포인트·알약 메뉴·따뜻한 회색 다크)를 따른다.
   차트 JS 가 cssVar() 로 읽는 토큰 이름(--text, --accent, --win, --g1… 등)은 그대로 유지한다. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&family=Poppins:wght@600;700&display=swap");

:root {
  color-scheme: light;
  --brand: #e66a1f;
  --topbar-bg: #ffffff;
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --border: #ececea;
  --text: #1f2733;
  --text-2: #586170;
  --text-3: #8993a1;
  --accent: #2a78d6;
  --win: #e66a1f;
  --row-hover: #f6f6f4;
  --win-row: #fdf0e8;
  --cta: #4a4c52; --cta-strong: #34363b; --cta-ink: #ffffff;
  --badge-plan: #e8f0fb; --badge-plan-text: #1d5aa6;
  --badge-win: #e2eee5; --badge-win-text: #28623f;
  --badge-wait: #eeefef; --badge-wait-text: #586170;
  --amber: #b6701f; --amber-soft: #f7ecd9; --amber-line: #e0be8e;
  --shadow: 0 1px 2px rgba(20, 25, 35, .05);
  --radius: 8px; --radius-lg: 12px;
  --font: "Noto Sans KR", "Pretendard", "Malgun Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
  --g1: #2a78d6; --g2: #eb6834; --g3: #1baf7a; --g4: #eda100;
  --g5: #e87ba4; --g6: #008300; --g7: #6250d6; --g8: #e34948; --g0: #b5b4ae;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --topbar-bg: #2f2d27;
    --bg: #2a2823; --surface: #333029; --surface-2: #3d3a32; --border: #4a463c;
    --text: #e6e9ed; --text-2: #a7b0ba; --text-3: #8b939d;
    --accent: #6a9be0; --win: #ef8a4b; --row-hover: #3a372f; --win-row: #45301c;
    --cta: #6a93c8; --cta-strong: #557fb5; --cta-ink: #0f141b;
    --badge-plan: #1e2c40; --badge-plan-text: #93b6e4;
    --badge-win: #152c22; --badge-win-text: #5bc78d;
    --badge-wait: #3d3a32; --badge-wait-text: #a7b0ba;
    --amber: #e6923f; --amber-soft: #3a2712; --amber-line: #6b4f1f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --g1: #3987e5; --g2: #d95926; --g3: #199e70; --g4: #c98500;
    --g5: #d55181; --g6: #2b9a2b; --g7: #9085e9; --g8: #e66767; --g0: #6b685f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --topbar-bg: #2f2d27;
  --bg: #2a2823; --surface: #333029; --surface-2: #3d3a32; --border: #4a463c;
  --text: #e6e9ed; --text-2: #a7b0ba; --text-3: #8b939d;
  --accent: #6a9be0; --win: #ef8a4b; --row-hover: #3a372f; --win-row: #45301c;
  --cta: #6a93c8; --cta-strong: #557fb5; --cta-ink: #0f141b;
  --badge-plan: #1e2c40; --badge-plan-text: #93b6e4;
  --badge-win: #152c22; --badge-win-text: #5bc78d;
  --badge-wait: #3d3a32; --badge-wait-text: #a7b0ba;
  --amber: #e6923f; --amber-soft: #3a2712; --amber-line: #6b4f1f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --g1: #3987e5; --g2: #d95926; --g3: #199e70; --g4: #c98500;
  --g5: #d55181; --g6: #2b9a2b; --g7: #9085e9; --g8: #e66767; --g0: #6b685f;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--badge-plan); }

/* ---- 상단 바 (common.js 가 모든 화면에 넣는다) ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--topbar-bg); border-bottom: 1px solid var(--border);
  padding: 12px 20px; display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 6px; flex-shrink: 0; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .b1 { font-family: "Poppins", var(--font); font-weight: 700; font-size: 21px; line-height: 1; letter-spacing: .005em; opacity: .9; }
.brand .mark { font-family: "Poppins", var(--font); font-weight: 700; font-size: 21px; line-height: 1; letter-spacing: .005em; color: var(--brand); }
.brand-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); align-self: flex-end; margin: 0 0 3px -3px; }
.brand .sub { font-size: 11px; color: var(--text-3); letter-spacing: .04em; margin-left: 4px; position: relative; top: -1.5px; }
.topnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  flex: none; white-space: nowrap; padding: 6px 12px; border-radius: 999px;
  color: var(--text-2); font-size: 12.5px; font-weight: 600; transition: background .15s ease, color .15s ease;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav a.on { background: var(--brand); color: #fff; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
@media (max-width: 1080px) {
  .topnav { order: 3; flex-basis: 100%; margin: 0 -8px; }
}
@media (max-width: 560px) {
  .topbar { padding: 10px 14px; }
  .brand .sub { display: none; }
}

/* 사용자 표시 (auth.js) */
.userbar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.userbar .who { display: flex; align-items: center; gap: 6px; }
.userbar .avatar {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); font-size: 10.5px; font-weight: 700;
}
.userbar .name { color: var(--text); font-weight: 500; }
.userbar .role::before { content: "·"; margin-right: 5px; }
.userbar .sep { width: 1px; height: 14px; background: var(--border); }
.userbar a { color: var(--brand); font-weight: 700; }
.userbar button {
  border: 1px solid var(--border); background: transparent; color: var(--text-2); border-radius: 999px;
  padding: 4px 11px; cursor: pointer; font-size: 11.5px;
}
.userbar button:hover { border-color: var(--text-3); color: var(--text); }
.userbar a.pending {
  display: inline-flex; align-items: center; gap: 5px; color: var(--amber); background: var(--amber-soft);
  border: 1px solid var(--amber-line); border-radius: 999px; padding: 2px 9px 2px 10px; font-size: 11.5px;
}
.userbar a.pending b {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--amber); color: #fff;
  font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 560px) { .userbar .role, .userbar .sep { display: none; } }

/* ---- 본문 ---- */
.nav { display: none; } /* 예전 메뉴 자리 — 메뉴는 상단 바로 옮겼다 */
.wrap { max-width: 1200px; margin: 0 auto; padding: 22px 20px 56px; }
header.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 18px; }
header.top h1 { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.01em; line-height: 1.2; }
header.top h1::before { content: ""; width: 5px; height: .82em; min-height: 15px; border-radius: 3px; background: var(--brand); flex-shrink: 0; }
.muted { color: var(--text-3); font-size: 12px; }
@media (max-width: 560px) { .wrap { padding: 16px 14px 48px; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 14px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.003em; }
@media (max-width: 560px) { .card { padding: 14px; } }
h2.sec { font-size: 15px; font-weight: 700; margin: 28px 0 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.grid2 .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + .grid2 { margin-top: 16px; }
.rules { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 12.5px; }
.rules li { margin-bottom: 6px; }
.rules b { color: var(--text); }
.formula { font-family: "Cambria Math", "Times New Roman", serif; font-size: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; overflow-x: auto; }
.back { display: inline-block; margin-bottom: 12px; font-size: 12.5px; color: var(--text-3); }

/* 숫자 타일 — Lynn 의 stat-row 처럼 한 줄로 이어 붙인다 */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.tiles:empty { display: none; }
.tile { background: var(--surface); padding: 13px 16px; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.tile .label { color: var(--text-3); font-size: 11.5px; }
.tile .value { font-size: 21px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--text-3); font-size: 11.5px; }

/* 입력 */
.form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form label { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); font-size: 11.5px; font-weight: 500; min-width: 0; }
.form select, .form input[type="text"], .form input[type="number"],
.filters input, .filters select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 10px; font-size: 13px; max-width: 100%; outline: none;
}
.form select:focus-visible, .form input:focus-visible, .filters input:focus-visible, .filters select:focus-visible { border-color: var(--text-3); }
.form input[type="range"] { width: 100%; accent-color: var(--brand); }
#proj { max-width: min(460px, 100%); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input { flex: 1 1 220px; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, var(--cta) 0%, var(--cta-strong) 100%); color: var(--cta-ink);
  font-weight: 700; font-size: 12.5px; line-height: 1.2; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 20, 35, .2), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: filter .15s ease, box-shadow .15s ease, transform .06s ease;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 3px 9px rgba(15, 20, 35, .22), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: wait; filter: none; transform: none; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips button { background: var(--surface-2); border: 1px solid transparent; color: var(--text-2); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 500; cursor: pointer; }
.chips button:hover { color: var(--text); }
.chips button.on { background: var(--text); color: var(--surface); }
.tabs { display: inline-flex; gap: 2px; margin-bottom: 12px; background: var(--surface-2); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; color: var(--text-2); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* 표 */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card .table-wrap { border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 12.5px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--text-2); font-weight: 600; font-size: 11.5px; position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
/* 긴 목록(입찰 리스트): 표 안에서 스크롤해 머리글 줄이 늘 보이게 한다. 상단 바·필터 높이를 뺀 만큼만 차지 */
.list-scroll { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); overflow: auto; }
.list-scroll th { box-shadow: inset 0 -1px 0 var(--border); }
@media (max-width: 1080px) { .list-scroll { max-height: calc(100dvh - 190px); } }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { color: var(--text-3); margin-left: 3px; }
td.num, th.num { text-align: right; }
td.name { white-space: normal; min-width: 240px; }
tbody tr:hover { background: var(--row-hover); }
tr.win-row, tr.win-row:hover { background: var(--win-row); }
tr.win-row td:first-child { box-shadow: inset 3px 0 0 var(--win); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.5; }
.badge.plan { background: var(--badge-plan); color: var(--badge-plan-text); }
.badge.win { background: var(--badge-win); color: var(--badge-win-text); }
.badge.wait { background: var(--badge-wait); color: var(--badge-wait-text); }
.badge.miss { background: var(--win-row); color: var(--win); }

.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 24px; }
.info div { display: flex; gap: 12px; }
.info dt { color: var(--text-3); min-width: 84px; font-size: 12.5px; }
.info dd { margin: 0; overflow-wrap: anywhere; }

.notice {
  background: var(--amber-soft); color: var(--text); border: 1px solid var(--amber-line);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px; font-size: 13px;
}
.notice.renotice { background: var(--badge-plan); border-color: transparent; }
.notice b { font-weight: 700; }

/* 차트 */
.chart-box { position: relative; height: 360px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-2); font-size: 12px; margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend i.line { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--text-2); }
.legend .lg-btn { font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: 999px; padding: 1px 8px; margin: -2px -8px; cursor: pointer; }
.legend .lg-btn:hover { border-color: var(--border); background: var(--surface-2); }
.legend .lg-btn.on { border-color: var(--text-3); color: var(--text); font-weight: 600; }
.legend .lg-btn.off { opacity: 0.45; }
.empty { color: var(--text-3); padding: 26px 16px; text-align: center; font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.bars { display: grid; gap: 6px; }
.bars .row { display: grid; grid-template-columns: 120px 1fr 70px; gap: 8px; align-items: center; font-size: 12.5px; }
.tip { position: fixed; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; font-size: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); z-index: 40; }
.netmap { width: 100%; height: auto; display: block; touch-action: manipulation; }
.netmap text { font-size: 11px; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; pointer-events: none; }
.netmap circle { cursor: pointer; stroke: var(--surface); stroke-width: 1.5; }
.netmap circle.sel { stroke: var(--text); stroke-width: 2.5; }
.netmap line { stroke: var(--text-3); }
.netmap line.hi { stroke: var(--text); }

/* ---- 로그인 게이트 (auth.js) — 잠금 중에는 상단바·본문을 숨기고 카드만 보인다 ---- */
html.auth-lock .wrap, html.auth-lock .topbar { display: none; }
.auth-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 384px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 30px 26px 26px; box-shadow: 0 8px 30px rgba(20, 25, 35, .06); }
.auth-card h1 { font-size: 18px; font-weight: 700; margin: 0 0 10px; letter-spacing: -.01em; }
.auth-card p { font-size: 13px; color: var(--text-2); line-height: 1.65; margin: 0; }
.auth-brand { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-bottom: 6px; color: var(--text); }
.auth-brand .b1, .auth-brand .mark { font-family: "Poppins", var(--font); font-weight: 700; font-size: 24px; line-height: 1; }
.auth-brand .mark { color: var(--brand); }
.auth-brand .brand-dot { width: 7px; height: 7px; margin: 0 0 4px -4px; }
.auth-sub { text-align: center; font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; margin-bottom: 22px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.auth-tabs button { flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 999px; cursor: pointer; color: var(--text-2); font-size: 12.8px; font-weight: 700; }
.auth-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 12px; }
.auth-field input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 14px; outline: none; }
.auth-field input:focus-visible { border-color: var(--text-3); background: var(--surface); }
.auth-submit { width: 100%; margin-top: 6px; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; background: var(--brand); border: 0; box-shadow: none; color: #fff; }
.auth-submit:hover { filter: brightness(1.05); box-shadow: none; }
.auth-link { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--text-2); font-size: 12px; text-decoration: underline; cursor: pointer; }
.auth-note { font-size: 11.5px; color: var(--text-3); line-height: 1.6; margin: 12px 0 0; }
.auth-error { display: none; font-size: 12px; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; background: var(--win-row); color: var(--text); border: 1px solid transparent; }
.auth-error.show { display: block; }
.auth-error.info { background: var(--badge-plan); color: var(--badge-plan-text); }
.sub-h { font-size: 14px; font-weight: 700; color: var(--text); margin: 18px 0 8px; }
