/* 원격관리 관리자 페이지 — 단순한 업무 화면. 휴대폰에서도 보이도록 좁은 화면을 기준으로 만든다.
   (화면 디자인은 대표 확인 뒤 다듬는다: 08 문서 6장) */
:root {
  --bg: #f5f6f8; --card: #fff; --text: #1f2328; --muted: #656d76; --line: #d8dde3;
  --brand: #1f5fbf; --brand-dark: #174a96; --ok: #1a7f37; --ok-bg: #e6f4ea; --bad: #c62828; --bad-bg: #fdecea; --wait: #8a6d00; --wait-bg: #fff6d6;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: .4rem 0 1rem; }
h1 small { font-size: .95rem; color: var(--muted); font-weight: normal; margin-left: .4rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
code { font-family: Consolas, "D2Coding", monospace; font-size: .92em; background: #eef1f4; padding: .05rem .3rem; border-radius: 4px; }
code.wrap { word-break: break-all; white-space: normal; }
small { color: var(--muted); }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .6rem 1rem; background: #1b2a41; color: #fff; }
.topbar a { color: #dfe7f3; }
.brand { font-weight: bold; color: #fff !important; font-size: 1.05rem; }
.menu { display: flex; flex-wrap: wrap; gap: .2rem .9rem; flex: 1; }
.who { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.who .role { color: #9fb0c8; }
.page { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.page-narrow { max-width: 460px; padding-top: 3rem; }
.brand-big { font-size: 1.3rem; font-weight: bold; color: var(--brand); margin-bottom: .5rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.card.important { border: 2px solid var(--brand); }
.form { display: flex; flex-direction: column; gap: .8rem; }
.form.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; color: var(--text); gap: .5rem; }
input, select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; }
button, .button { font: inherit; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; display: inline-block; }
button:hover, .button:hover { background: #f0f3f6; text-decoration: none; }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--brand-dark); }
button.danger { color: var(--bad); border-color: #efb4b0; }
button.link { background: none; border: none; color: #dfe7f3; padding: 0; text-decoration: underline; }
form.inline { display: inline; }
.row-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }

.notice { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.notice-error { background: var(--bad-bg); color: var(--bad); border: 1px solid #f3c1bc; }
.notice-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e1c1; }
.hint { color: var(--muted); font-size: .9rem; }

.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.grid th, .grid td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid th { background: #eef1f4; font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.grid.small td { font-size: .85rem; }
.grid tr.dim td { color: var(--muted); }
.actions { white-space: nowrap; }
.actions form { margin-right: .3rem; }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-wait { background: var(--wait-bg); color: var(--wait); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .9rem; color: var(--text); }
.tile:hover { border-color: var(--brand); text-decoration: none; }
.tile-title { font-weight: 600; }
.tile-num { font-size: 1.8rem; font-weight: bold; }
.tile-num small { font-size: .9rem; margin-left: .2rem; }
.tile-sub { font-size: .85rem; color: var(--muted); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 .8rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.serial-list { columns: 2; font-size: 1.05rem; }
.serial-list li { margin: .2rem 0; }
.steps li { margin: .3rem 0; }
.qr { display: block; width: 220px; height: 220px; margin: .5rem 0; image-rendering: pixelated; }
.secret { font-size: 1rem; letter-spacing: .05em; }
.pre { white-space: pre-wrap; word-break: break-all; max-height: 480px; overflow: auto; background: #f6f8fa; padding: .6rem; border-radius: 6px; font-size: .82rem; }
.checklist { display: flex; flex-direction: column; gap: .3rem; max-height: 320px; overflow: auto; }
details { margin-bottom: .5rem; }

@media (max-width: 700px) {
  .grid { display: block; overflow-x: auto; white-space: nowrap; }
  .form.row { flex-direction: column; align-items: stretch; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: .4rem; }
  .serial-list { columns: 1; }
}

/* 사용성 개선 1단계: 큰 버튼, 보낼 문구 상자, 접어 두는 칸 */
.button.big { display: inline-block; font-size: 1.1rem; padding: .8rem 1.4rem; }
.big-text { font-size: 1.2rem; }
.share-text { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: .9rem; padding: .6rem; border: 1px solid var(--line); border-radius: 6px; background: #f6f8fa; resize: vertical; }
details.more { flex-basis: 100%; }
details.more summary { cursor: pointer; color: var(--brand); font-size: .9rem; }
details.more .form.row { margin-top: .6rem; }
