/* 관리자 화면 — 뉴미라클(new-miracle.co.kr) 느낌: 흰 바탕·짙은 회색·청록 파랑, Montserrat 대문자, Georgia 기울임 */
:root {
  --bg: #f7f7f5; --panel: #fff; --line: #e4e4e1; --line-2: #d4d4d0;
  --text: #212121; --muted: #7a7a76; --blue: #1c6b8c; --blue-soft: #eaf2f5; --red: #c43d3d;
  --en: "Montserrat", "Pretendard", sans-serif; --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Pretendard", -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
.en { font-family: var(--en); letter-spacing: .16em; text-transform: uppercase; }
.quote { font-family: var(--serif); font-style: italic; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 1px solid var(--line-2); background: #fff; border-radius: 0; cursor: pointer; white-space: nowrap; font-size: 13px; transition: .2s; color: var(--text); }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=url], input[type=password], input:not([type]), textarea, select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 0; background: #fff; outline: none; transition: border-color .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
textarea { resize: vertical; min-height: 70px; line-height: 1.6; }
.muted { color: var(--muted); }
h2 { font-weight: 500; font-size: 22px; }

/* 로그인: 왼쪽 유리 건물 사진, 오른쪽 흰 폼 */
.login-wrap { display: grid; grid-template-columns: 1.25fr 1fr; min-height: 100vh; background: #fff; }
.login-art { position: relative; background: #1d2a33 url("/admin/img/glass.webp") 38% center/cover; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 56px; }
.login-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0,0,0,.55)); }
.login-art > * { position: relative; }
.login-art .en { font-size: 13px; opacity: .85; margin-bottom: 14px; }
.login-art .quote { font-size: clamp(22px, 2.6vw, 34px); line-height: 1.35; max-width: 560px; }
.login-art .tags { margin-top: 18px; font-family: var(--en); font-size: 13px; opacity: .8; }
.login { align-self: center; justify-self: center; width: min(360px, 100% - 32px); display: grid; gap: 16px; }
.login .en { font-size: 12px; color: var(--muted); }
.login h1 { font-weight: 400; font-family: var(--serif); font-style: italic; font-size: 30px; }
.login .btn { padding: 13px; }

/* 상단 */
.top { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); gap: 12px; position: sticky; top: 0; z-index: 10; }
.top .logo { font-family: var(--en); font-size: 15px; letter-spacing: .14em; color: rgba(6,6,6,.6); }
.top .logo b { color: var(--text); font-weight: 500; }
.top nav { display: flex; gap: 8px; align-items: center; }

/* 사이트 목록 */
.banner { position: relative; height: 260px; background: #222 url("/admin/img/interior.webp") center 55%/cover; display: flex; align-items: flex-end; color: #fff; }
.banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.05)); }
.banner .inner { position: relative; max-width: 1160px; width: 100%; margin: 0 auto; padding: 0 24px 34px; }
.banner .quote { font-size: 30px; }
.banner .en { font-size: 12px; margin-top: 10px; opacity: .85; letter-spacing: .1em; text-transform: none; }
.dash { max-width: 1160px; margin: 0 auto; padding: 40px 24px 80px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.dash-head .en { font-size: 12px; color: var(--blue); margin-bottom: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 22px; margin-top: 28px; }
.card { background: #fff; display: grid; grid-template-rows: auto 1fr; border: 1px solid transparent; transition: .25s; }
.card:hover { border-color: var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.card .cover { aspect-ratio: 4 / 3; background: #e9e9e6 center/cover; position: relative; cursor: pointer; }
.card .cover .state { position: absolute; top: 12px; left: 12px; }
.card .body { padding: 16px 16px 18px; display: grid; gap: 6px; align-content: start; }
.card h3 { font-family: var(--en); font-weight: 500; font-size: 16px; letter-spacing: .02em; }
.card .addr { font-size: 12px; color: var(--muted); word-break: break-all; }
.card .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.card.new { border: 1px dashed var(--line-2); background: transparent; display: flex; align-items: center; justify-content: center; min-height: 300px; cursor: pointer; color: var(--muted); }
.card.new:hover { color: var(--text); border-color: var(--text); box-shadow: none; }
.card.new span { font-family: var(--en); letter-spacing: .14em; font-size: 13px; }
.tag { display: inline-block; font-size: 11px; padding: 3px 9px; background: rgba(255,255,255,.92); color: var(--muted); font-family: var(--en); letter-spacing: .08em; }
.tag.on { background: var(--blue); color: #fff; }
.tag.plain { background: #f0f0ed; }

/* 모달 */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,20,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; padding: 32px; width: min(720px, 100%); max-height: 92vh; overflow: auto; display: grid; gap: 16px; }
.modal .en { font-size: 12px; color: var(--blue); }
.modal h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 28px; margin-top: -8px; }
.tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpl { border: 1px solid var(--line); padding: 0; cursor: pointer; text-align: left; background: #fff; display: grid; grid-template-rows: 110px auto; transition: .2s; }
.tpl .img { background: #ddd center/cover; }
.tpl .txt { padding: 10px 12px 12px; }
.tpl b { display: block; font-weight: 600; margin-bottom: 2px; }
.tpl span { font-size: 12px; }
.tpl.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }

/* 편집기 */
.editor { display: grid; grid-template-rows: 56px 1fr; height: 100vh; }
.ebar { display: flex; align-items: center; gap: 10px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.ebar .name { font-family: var(--en); font-weight: 500; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebar .sp { flex: 1; }
.ebar .state { font-size: 11px; color: var(--muted); font-family: var(--en); letter-spacing: .06em; }
.device { display: inline-flex; border: 1px solid var(--line); }
.device button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; font-size: 12px; }
.device button.on { background: var(--text); color: #fff; }
.ebody { display: grid; grid-template-columns: 250px 1fr 340px; min-height: 0; }
.left, .right { background: #fff; overflow: auto; min-height: 0; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
.pane-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 8px; font-family: var(--en); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.list { padding: 0 8px 8px; display: grid; gap: 1px; }
.item { display: flex; align-items: center; gap: 6px; padding: 9px 10px; cursor: pointer; border-left: 2px solid transparent; }
.item:hover { background: #f6f6f4; }
.item.on { background: var(--blue-soft); border-left-color: var(--blue); color: var(--blue); }
.item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .ops { display: none; gap: 2px; }
.item:hover .ops, .item.on .ops { display: flex; }
.ico { border: 0; background: none; cursor: pointer; padding: 2px 5px; color: var(--muted); font-size: 13px; }
.ico:hover { background: #ececea; color: var(--text); }
.center { min-height: 0; display: flex; justify-content: center; background: #ececea; overflow: hidden; padding: 14px; }
.center iframe { width: 100%; height: 100%; border: 0; background: #fff; box-shadow: 0 6px 30px rgba(0,0,0,.08); transition: width .2s; }
.center.mobile iframe { width: 390px; }

.props { padding: 4px 16px 32px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--muted); }
.img-field { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: center; }
.img-field .thumb { width: 72px; height: 54px; background: #eeeeeb center/cover no-repeat; border: 1px solid var(--line); }
.img-field .acts { display: flex; gap: 4px; }
.sublist { display: grid; gap: 8px; }
.subitem { border: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; background: #fafaf8; }
.subitem .bar { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.tabs-r { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.tabs-r button { flex: 1; border: 0; background: none; padding: 15px 6px 13px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 13px; }
.tabs-r button.on { color: var(--text); border-color: var(--text); font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.addmenu { display: grid; gap: 4px; padding: 0 8px 12px; }
.addmenu button { text-align: left; border: 1px solid var(--line); background: #fff; padding: 9px 11px; cursor: pointer; }
.addmenu button:hover { border-color: var(--blue); color: var(--blue); }

/* 신청 내역 */
table.leads { width: 100%; border-collapse: collapse; background: #fff; border-top: 2px solid var(--text); }
.leads th, .leads td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
.leads th { color: var(--muted); font-weight: 500; font-family: var(--en); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .quote { font-size: 22px; color: var(--text); margin-bottom: 8px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 11px 20px; opacity: 0; transition: .3s; pointer-events: none; z-index: 200; font-size: 13px; }
#toast.show { opacity: 1; }

@media (max-width: 1100px) { .ebody { grid-template-columns: 220px 1fr 300px; } }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { min-height: 42vh; padding: 28px; }
  .login { padding: 36px 0; }
  .ebody { grid-template-columns: 1fr; grid-template-rows: auto 60vh auto; overflow: auto; }
  .editor { height: auto; min-height: 100vh; }
  .left, .right { border: 0; }
  .ebar { flex-wrap: wrap; height: auto; padding: 8px; }
  .top { padding: 0 16px; }
  .tpls { grid-template-columns: 1fr; }
  .banner { height: 200px; }
  .banner .quote { font-size: 22px; }
}

/* 알림·버튼 반응 */
#toast { top: 66px; bottom: auto; transform: translate(-50%, -10px); display: flex; gap: 12px; align-items: center; padding: 13px 20px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
#toast.show { transform: translate(-50%, 0); pointer-events: auto; }
#toast.ok { background: #1c6b8c; }
#toast.err { background: #b23b3b; }
#toast a { color: #fff; text-decoration: underline; font-weight: 600; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: attr(data-busy); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.btn.primary.busy::after, .btn.blue.busy::after { color: rgba(255,255,255,.85); }
.btn.done { background: #1c6b8c !important; border-color: #1c6b8c !important; color: #fff !important; }
.btn.fail { background: #b23b3b !important; border-color: #b23b3b !important; color: #fff !important; }
.state.dirty { color: #b26a00; }
.state.live { color: var(--blue); }
