/* 관리자 화면(PC) 전용. 직원 화면(app.css)과 같은 색·글꼴 — 남색 판 + 노란 중앙선.
   상징 = 왼쪽 메뉴가 «도로»: 지금 메뉴 왼쪽에 노란 점선 중앙선이 그어진다. */
:root {
  --ink: #0e2240; --ink-2: #183559;
  --steel: #2457a6; --steel-press: #1b4486;
  --signal: #ffc531; --signal-press: #f0b310;
  --go: #12925a; --warn: #c27c00; --danger: #c2362b;
  --paper: #edf1f6; --card: #ffffff; --text: #13203a; --muted: #5f6e85; --line: #dce3ec; --line-2: #eef2f7;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", system-ui, sans-serif;
  --num: "Barlow Condensed", "Pretendard Variable", sans-serif;
  --shadow: 0 1px 2px rgba(14, 34, 64, .06), 0 8px 24px -14px rgba(14, 34, 64, .2);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #0b1b33; --ink-2: #1a3a63; --steel: #4a82d6; --steel-press: #3a6fc0; --warn: #e3a230;
    --paper: #0a1322; --card: #121d31; --text: #e6ecf5; --muted: #93a1b8; --line: #23324c; --line-2: #1a2740;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body.admin {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
}
body.admin main { margin: 0; padding: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13.5px; }
.err { color: var(--danger); font-size: 14px; }
.err:empty { display: none; }
a { color: var(--steel); }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* ── 버튼·입력 ─────────────────────────────── */
button {
  font: inherit; cursor: pointer; min-height: 38px; padding: 7px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: 14px;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
button:hover { border-color: var(--steel); color: var(--steel); }
button:active { transform: scale(.98); }
button.primary {
  min-height: 44px; padding: 10px 20px; border: none; border-radius: 12px;
  background: var(--steel); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 16px -8px rgba(36, 87, 166, .7);
}
button.primary:hover { background: var(--steel-press); color: #fff; }
input, select {
  font: inherit; width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--steel); box-shadow: 0 0 0 4px rgba(36, 87, 166, .15); }
input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--steel); vertical-align: -3px; margin-right: 6px; }
input[type=file] { padding: 7px 10px; font-size: 13.5px; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 10px; padding: 5px 12px; border-radius: 8px;
  border: none; background: var(--ink); color: #fff; cursor: pointer;
}
.card > button { margin: 0 8px 8px 0; }
select {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6e85' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 18px;
}

/* ── 틀: 왼쪽 메뉴 + 오른쪽 ─────────────────── */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
  padding: 20px 12px 16px; background: var(--ink); color: #c4d1e3;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; color: #fff; font-weight: 800; font-size: 16px; line-height: 1.25; }
.side .brand img { width: 36px; height: 36px; border-radius: 10px; }
.side .brand small { display: block; font-weight: 600; font-size: 12px; color: var(--signal); letter-spacing: .02em; }
.side button {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 10px 12px 10px 18px;
  border: none; border-radius: 12px; background: transparent; color: inherit; text-align: left; font-size: 14.5px; font-weight: 500;
}
.side button svg { opacity: .75; }
.side button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side button.on { background: var(--ink-2); color: #fff; font-weight: 700; }
.side button.on svg { opacity: 1; color: var(--signal); }
.side button.on::before {
  content: ''; position: absolute; left: 6px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px;
  background: repeating-linear-gradient(to bottom, var(--signal) 0 5px, transparent 5px 9px);
}
.side .grow { flex: 1; }
.side a {
  display: flex; align-items: center; gap: 8px; margin: 0 4px; padding: 10px 12px; border-radius: 12px;
  border: 1px dashed #2c4870; color: #aebfd6; font-size: 13px; text-decoration: none;
}
.side a:hover { color: #fff; border-color: #4c6488; }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 32px;
  background: color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top h1 { flex: 1; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.top input[type=month] { width: auto; min-height: 40px; font-family: var(--num); font-size: 18px; font-weight: 600; padding: 6px 10px; }
.top .who { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.content { padding: 26px 32px 64px; max-width: 1400px; }

/* ── 카드·소제목 ───────────────────────────── */
.card { background: var(--card); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow); }
.content > .card { padding: 24px 28px; }
.card h3 { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.card h3::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: var(--signal); }
.card h3:first-child { margin-top: 0; }
.card > p.muted { margin: -4px 0 12px; }

/* ── 한눈에: 숫자 카드 ─────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  --k: var(--steel);
  position: relative; overflow: hidden; cursor: pointer; padding: 20px 22px 18px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow); border: 1.5px solid transparent;
  transition: transform .15s ease, border-color .15s ease;
}
.kpi::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--k); }
.kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--k) 40%, transparent); }
.kpi.ok { --k: var(--go); } .kpi.warn { --k: var(--warn); } .kpi.danger { --k: var(--danger); }
.kpi .lbl { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .num { font-family: var(--num); font-size: 44px; font-weight: 700; line-height: 1.05; margin: 8px 0 4px; color: var(--k); letter-spacing: .01em; }
.kpi .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── 표 ───────────────────────────────────── */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th {
  position: sticky; top: 0; background: var(--line-2); color: var(--muted);
  font-size: 12.5px; font-weight: 700; text-align: left; padding: 10px 12px; white-space: nowrap;
}
th:first-child { border-radius: 10px 0 0 10px; } th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: color-mix(in srgb, var(--steel) 5%, transparent); }
td b { font-family: var(--num); font-size: 17px; font-weight: 700; }
td button { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.scroll { overflow-x: auto; }

/* 작성 현황 격자: 칸 = 작은 둥근 사각 */
.grid-board th.d, .grid-board td.d { width: 28px; padding: 4px 2px; text-align: center; font-family: var(--num); font-size: 14px; }
.grid-board td.d { border-bottom: none; }
.grid-board td.d::after { content: ''; display: block; width: 20px; height: 20px; margin: 0 auto; border-radius: 6px; background: var(--line-2); }
.grid-board td.w::after { background: var(--go); }
.grid-board td.m::after { background: color-mix(in srgb, var(--danger) 75%, transparent); }
.grid-board td:first-child, .grid-board th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); }
.grid-board th:first-child { background: var(--line-2); }

/* 상태 표시 */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--line-2); color: var(--muted); }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: color-mix(in srgb, var(--go) 14%, transparent); color: var(--go); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.pill.lock { background: var(--ink); color: var(--signal); }

/* 1,500만원 막대 */
.bar { position: relative; height: 12px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 6px; }
.bar .line { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .7; }
.lv-ok { background: var(--go); } .lv-warn { background: var(--signal); } .lv-danger { background: var(--danger); }

/* 입력 줄 */
form.inline {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 14px; align-items: end;
  margin: 6px 0 4px; padding: 18px; border-radius: 14px; background: var(--line-2);
}
form.inline label { font-size: 13px; font-weight: 600; color: var(--muted); }
form.inline label input, form.inline label select { margin-top: 5px; }
form.inline button.primary { justify-self: start; }

/* ── 로그인 ───────────────────────────────── */
.login-wrap {
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(90% 70% at 85% 0%, var(--ink-2) 0%, var(--ink) 60%);
}
.login-wrap::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, var(--signal) 0 26px, transparent 26px 50px); opacity: .25;
}
.login-wrap .card { position: relative; width: 100%; max-width: 400px; padding: 34px 32px; border-radius: 24px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); }
.login-wrap img { width: 52px; height: 52px; border-radius: 14px; }
.login-wrap h2 { margin: 16px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.login-wrap label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-wrap label input { margin-top: 6px; min-height: 48px; }
.login-wrap button.primary { width: 100%; min-height: 50px; margin-top: 6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .side .brand { width: 100%; padding-bottom: 8px; }
  .side button { width: auto; padding: 8px 12px; }
  .side button.on::before { display: none; }
  .side .grow, .side a { display: none; }
  .top { padding: 10px 14px; flex-wrap: wrap; }
  .content { padding: 14px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
