/* BS Works 관문·관리 화면. 외부 리소스 없음(CSP: style-src 'self'). 글꼴은 Pretendard(OFL, fonts/LICENSE-Pretendard-OFL.txt). */
@font-face {
  font-family: 'Pretendard Variable';
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url('fonts/PretendardVariable.woff2') format('woff2-variations');
}

:root {
  --p: #004282;
  --ph: #003469;
  --tint: #eef4fb;
  --bg: #f8f9fa;
  --fg: #1d2327;
  --fg2: #666;
  --fg3: #8c8f94;
  --bd: #e5e5e5;
  --ok-bg: #d4edda;
  --ok-fg: #155724;
  --wait-bg: #fff3cd;
  --wait-fg: #856404;
  --err-bg: #fdecea;
  --err-fg: #8a1f17;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
body.is-busy .content { pointer-events: none; opacity: .7; }

h1 { margin: 4px 0; font-size: 24px; }
.muted { color: var(--fg2); font-size: 13px; }
.over { font-size: 11px; letter-spacing: .14em; color: var(--p); font-weight: 700; }
.nowrap { white-space: nowrap; }

/* 로그인 확인 중·안내 */
.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  color: var(--fg2);
  font-size: 15px;
}
.gate img { border-radius: 10px; }

/* 버튼 */
.btn {
  background: var(--p);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--ph); }
.btn-ghost {
  display: inline-block;
  background: #fff;
  color: var(--p);
  border: 1px solid var(--p);
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--tint); }
.btn-ghost.solid { background: var(--p); color: #fff; }
.btn-ghost.solid:hover { background: var(--ph); }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }

/* 상단 바 */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--bd);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.brand b { font-size: 15px; letter-spacing: .02em; }
.sp { flex: 1; }
.who { font-size: 12px; color: var(--fg2); text-align: right; line-height: 1.3; }
.who b { display: block; color: var(--fg); font-size: 13px; }
.who span { display: block; }

/* 관문 */
.hub { max-width: 1180px; margin: 0 auto; padding: 32px 20px 48px; }
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 18px; }
.card {
  display: block;
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}
a.card:hover { border-color: var(--p); box-shadow: 0 2px 10px rgba(0, 66, 130, .12); }
.card .ic {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--p);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}
.card .ttl { margin: 10px 0 2px; font-size: 16px; }
.card .sub { font-size: 12px; color: var(--fg3); }
.card .d { font-size: 13px; color: var(--fg2); margin: 8px 0 12px; min-height: 40px; }
.card .chip { font-size: 13px; font-weight: 700; color: var(--p); }
.card.off { opacity: .45; cursor: default; }
.card.off .chip { color: var(--fg3); }
.notice {
  background: var(--tint);
  border: 1px solid #d6e4f2;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  margin-top: 18px;
}

/* 관리 */
.adm { display: grid; grid-template-columns: 170px 1fr; min-height: calc(100vh - 53px); }
.side { background: #fff; border-right: 1px solid var(--bd); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.tab {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.tab:hover { background: var(--bg); }
.tab.is-active { background: var(--tint); color: var(--p); font-weight: 700; }
.content { padding: 16px; min-width: 0; }
.cap { margin: 22px 0 8px; font-size: 14px; font-weight: 700; }
.cap:first-child { margin-top: 0; }
.note { margin: 8px 0; }

.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.inp {
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: #fff;
}
.bar .inp { flex: 1 1 200px; min-width: 0; }
.bar .btn { padding: 8px 14px; font-size: 13px; }

.msg { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.msg.ok { background: var(--ok-bg); color: var(--ok-fg); }
.msg.err { background: var(--err-bg); color: var(--err-fg); font-weight: 600; }

.code {
  margin-bottom: 14px;
  border: 1px dashed var(--p);
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.code .c { font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: .12em; color: var(--p); user-select: all; }

.tablewrap { overflow-x: auto; border: 1px solid var(--bd); border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
th { text-align: left; font-size: 11px; color: var(--fg2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--bd); background: #fafbfc; white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.acts { white-space: nowrap; }
td.acts .btn-ghost + .btn-ghost { margin-left: 6px; }

.st { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.st.wait { background: var(--wait-bg); color: var(--wait-fg); }
.st.act { background: var(--ok-bg); color: var(--ok-fg); }
.st.stop { background: #f1f1f1; color: var(--fg2); }
.st.m { background: var(--p); color: #fff; }

/* 스위치: 실제 체크박스를 쓰고 모양만 바꾼다(키보드·스크린리더 지원). */
.sw { position: relative; display: inline-block; width: 34px; height: 19px; vertical-align: middle; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sw .tg { position: absolute; inset: 0; border-radius: 10px; background: #c3c4c7; pointer-events: none; transition: background .15s; }
.sw .tg::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw input:checked + .tg { background: var(--p); }
.sw input:checked + .tg::after { left: 17px; }
.sw input:disabled { cursor: not-allowed; }
.sw input:disabled + .tg { opacity: .5; }
.sw input:focus-visible + .tg { outline: 2px solid var(--p); outline-offset: 2px; }

@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .card .d { min-height: 0; }
  .who { display: none; }
  .hub { padding: 24px 16px 40px; }
  .adm { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--bd); }
  .tab { width: auto; }
  .content { padding: 12px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
