/* 관리자 화면 — PC 브라우저용 */
:root {
  --blue: #4482F0; --blue-dark: #2B5FC7; --navy: #181734; --gold: #FFAC0A; --red: #FF4E4E;
  --blue-light: #EEF4FD; --text: #171717; --sub: #5b5b66; --line: #E3E8F2; --bg: #F2F5FB; --white: #fff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: "Noto Sans KR", sans-serif; font-size: 15px; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
.muted { color: var(--sub); }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }

/* ---------- 로그인·첫 설정 ---------- */
.auth {
  width: 100%; max-width: 420px; background: var(--white); border-radius: 22px;
  padding: 36px 34px; box-shadow: 0 16px 40px rgba(24, 23, 52, .08);
}
.auth img { height: 26px; margin-bottom: 22px; }
.auth h1 { font-size: 24px; font-weight: 900; color: var(--navy); }
.auth p { margin-top: 8px; color: var(--sub); line-height: 1.6; }
.auth form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.auth .back { display: inline-block; margin-top: 18px; font-size: 14px; }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--sub); }
label.f.inline { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], input[type=email], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--white); color: var(--text); font-size: 15px; font-weight: 400;
}
textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(68, 130, 240, .35); border-color: var(--blue); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--white); color: var(--navy); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:disabled { background: #b9cdf5; border-color: #b9cdf5; cursor: default; }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; }

/* ---------- 관리 화면 틀 ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: var(--navy); color: #fff;
}
.top img { height: 22px; }
.top .title { font-weight: 900; font-size: 17px; }
.top .space { flex: 1; }
.top .me { font-size: 14px; color: var(--gold); font-weight: 700; }
.top .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }

.layout { display: flex; min-height: calc(100vh - 54px); }
nav.side { flex: 0 0 230px; background: var(--white); border-right: 1px solid var(--line); padding: 18px 12px; }
nav.side .grp { font-size: 12px; font-weight: 700; color: var(--sub); padding: 14px 12px 6px; }
nav.side a {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--text);
  text-decoration: none; font-weight: 500;
}
nav.side a.on { background: var(--blue-light); color: var(--blue); font-weight: 700; }
nav.side a .lock { font-size: 11px; color: var(--gold); margin-left: 4px; }
main.body { flex: 1; min-width: 0; padding: 28px 32px 120px; max-width: 1100px; }

.head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h2 { font-size: 24px; font-weight: 900; color: var(--navy); }
.head p { color: var(--sub); margin-top: 6px; line-height: 1.6; }
.head .space { flex: 1; }
.updated { font-size: 13px; color: var(--sub); margin-top: 4px; }

/* ---------- 항목 카드 ---------- */
.item {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 14px;
}
.item.off { opacity: .55; }
.item .bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.item .bar .tag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--blue-light); color: var(--blue); }
.item .bar .name { font-weight: 900; color: var(--navy); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid .wide { grid-column: 1 / -1; }
.help { font-size: 12px; font-weight: 400; color: var(--sub); }

.sub { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sub .row { display: flex; gap: 8px; align-items: flex-start; }
.sub .row > * { flex: 1; }
.sub .row .x { flex: 0 0 auto; }

.adds { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px; }
.savebar {
  position: fixed; left: 230px; right: 0; bottom: 0; z-index: 9;
  display: flex; align-items: center; gap: 12px; justify-content: flex-end;
  padding: 14px 32px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
}
.savebar .msg { flex: 1; color: var(--sub); font-size: 14px; }
.savebar .msg.dirty { color: var(--blue); font-weight: 700; }

table.t { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 14px; overflow: hidden; }
table.t th, table.t td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.t th { background: #F7F9FD; color: var(--sub); font-weight: 700; font-size: 13px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-top: 18px; }
.panel h3 { font-size: 16px; font-weight: 900; color: var(--navy); margin-bottom: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; font-weight: 700;
}
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--red); }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  nav.side { flex: none; border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; padding: 8px; }
  nav.side .grp { display: none; }
  nav.side a { white-space: nowrap; }
  main.body { padding: 20px 16px 120px; }
  .savebar { left: 0; padding: 12px 16px; }
  .top { padding: 12px 16px; flex-wrap: wrap; }
}
