/* 관리자 화면 — admin.css */
:root {
  --bg: #0e0c12; --bg-2: #16131d; --bg-3: #1f1a29; --line: #2c2537; --line-soft: #221c2c;
  --text: #f1ecf4; --text-2: #b8afc4; --text-3: #7d738a;
  --pink: #ff4fb5; --violet: #7a5cff; --pink-text: #ff7fc9; --glow: rgba(255,79,181,.35);
  --ok: #5ad48e; --danger: #ff6b6b;
  --font-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.6; word-break: keep-all; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn-primary { background: linear-gradient(120deg, var(--pink), var(--violet)); color: #fff; box-shadow: 0 6px 20px -8px var(--glow); }
.btn-primary:disabled { opacity: .5; cursor: wait; }
.btn-ghost { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.22); color: var(--text); }
.btn-ghost:hover { border-color: rgba(255,255,255,.5); }
.btn-danger { background: none; border-color: transparent; color: var(--danger); padding: 6px 10px; font-weight: 500; }
.btn-danger:hover { background: rgba(255,107,107,.1); }
.icon-btn { background: var(--bg); border: 1px solid var(--line); color: var(--text-2); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--text-3); }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(60% 50% at 80% 10%, rgba(122,92,255,.18), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 32px 28px; display: grid; gap: 14px; }
.login-card img { height: 40px; width: auto; margin-bottom: 4px; }
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-card .btn { margin-top: 6px; }
.login-card .back { font-size: 13px; color: var(--text-3); text-align: center; }
.msg { font-size: 13.5px; color: var(--danger); min-height: 1.2em; }

/* 공통 필드 */
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field input, .field textarea, .edit-table input, .inline-form input, .notice-editor input, .notice-editor textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; color: var(--text); transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .edit-table input:focus, .inline-form input:focus, .notice-editor input:focus, .notice-editor textarea:focus { border-color: var(--pink); outline: none; }
textarea { resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { accent-color: var(--pink); }

/* 앱 레이아웃 */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(16px, 3vw, 28px); height: 60px; background: rgba(14,12,18,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left img { height: 28px; width: auto; }
.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--text-3); font-family: var(--font-mono); }

.layout { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 60px); }
.tabs { border-right: 1px solid var(--line-soft); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--bg-2); }
.tab { text-align: left; background: none; border: 0; padding: 11px 14px; border-radius: 8px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab.active { background: rgba(255,79,181,.12); color: var(--pink-text); font-weight: 700; }
.panel { padding: clamp(20px, 3vw, 36px); max-width: 1080px; width: 100%; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pane-head h2 { font-size: 22px; font-weight: 700; }
.pane-foot { margin-top: 24px; display: flex; justify-content: flex-end; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { color: var(--text-3); font-size: 13.5px; margin-bottom: 18px; max-width: 70ch; }
.sub-h { font-size: 16px; font-weight: 700; margin: 30px 0 10px; display: flex; gap: 10px; align-items: baseline; }
.sub-h small { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.sub-h:first-of-type { margin-top: 6px; }

/* 문구 폼 */
.grid-form { display: grid; gap: 22px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 18px 18px 20px; display: grid; gap: 14px; margin: 0; background: var(--bg-2); }
legend { padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--pink-text); letter-spacing: .04em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.row3 .field-wide { grid-column: span 2; }

/* 리스트 카드(하는 일 / 드론) */
.list { display: grid; gap: 10px; }
.card { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card .no { font-family: var(--font-mono); font-size: 12px; color: var(--pink-text); padding-top: 10px; }
.card .fields { display: grid; gap: 10px; }
.card .ctrl { display: flex; flex-direction: column; gap: 4px; }
.card.drone { grid-template-columns: 120px 1fr auto; }
.thumb { width: 120px; aspect-ratio: 3/2; object-fit: cover; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line); }
.thumb-wrap { display: grid; gap: 6px; }
.thumb-wrap .upload-btn { font-size: 12px; padding: 6px 10px; }
.upload-btn { cursor: pointer; }

/* 사진 관리 */
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.photo-admin li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; }
.photo-admin img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo-admin .pbody { padding: 10px; display: grid; gap: 8px; }
.photo-admin .prow { display: flex; gap: 6px; align-items: center; }
.photo-admin select { width: auto; padding: 6px 8px; }
.progress { font-size: 13px; color: var(--pink-text); margin-bottom: 12px; }

/* 표 편집 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.edit-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.edit-table th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 500; padding: 10px 8px; border-bottom: 1px solid var(--line); letter-spacing: .06em; }
.edit-table td { padding: 5px 4px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.edit-table td:first-child { padding-left: 8px; }
.edit-table input { padding: 7px 9px; }
.edit-table td.ctl { white-space: nowrap; width: 110px; text-align: right; padding-right: 8px; }
.edit-table td.ctl button { margin-left: 2px; }
.table-wrap + .btn { margin-top: 10px; }

/* 소식 */
.notice-editor { display: grid; gap: 12px; background: var(--bg-2); border: 1px solid var(--pink); border-radius: 10px; padding: 18px; margin-bottom: 20px; }
.notice-admin { display: grid; gap: 8px; }
.notice-admin li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.notice-admin .nt { font-weight: 500; }
.notice-admin .nd { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin-right: 8px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-3); margin-left: 8px; vertical-align: middle; }
.badge.on { color: var(--ok); border-color: rgba(90,212,142,.4); }

/* 문의 게시판 */
.inq-list { display: grid; gap: 10px; }
.inq { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; }
.inq.answered { border-color: rgba(90,212,142,.35); }
.inq-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--text-2); }
.inq-top .t { font-size: 16px; font-weight: 700; color: var(--text); flex-basis: 100%; }
.inq-top .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.inq-body { white-space: pre-wrap; color: var(--text-2); font-size: 14.5px; line-height: 1.6; padding: 10px 12px; background: var(--bg); border-radius: 6px; }
.inq-answer { display: grid; gap: 8px; }
.inq-answer textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; color: var(--text); min-height: 80px; }
.inq-answer textarea:focus { border-color: var(--pink); outline: none; }
.inq-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }

/* 관리자 */
.inline-form { display: flex; gap: 8px; max-width: 480px; margin-bottom: 16px; }
.admin-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-family: var(--font-mono); font-size: 13.5px; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #111; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 100; max-width: calc(100% - 32px); }
.toast.err { background: var(--danger); color: #fff; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 8px 12px; gap: 2px; }
  .tab { white-space: nowrap; padding: 9px 12px; font-size: 14px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .row3 .field-wide { grid-column: auto; }
  .card, .card.drone { grid-template-columns: 1fr; }
  .card .ctrl { flex-direction: row; }
  .who { display: none; }
}
