body.admin { padding-bottom: 40px; background: #fafafa; }
.ad-top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; flex-wrap: wrap; }
.ad-title { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ad-back { width: 32px; height: 32px; border-radius: 50%; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: var(--fg); }
.ad-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-actions .btn { height: 38px; font-size: 14px; padding: 0 14px; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.pill.ok { background: #e9f6ec; color: var(--ok); }
.pill.bad { background: #fdecea; color: var(--new); }
.ad-main { padding: 14px 20px; max-width: 1500px; margin: 0 auto; }
.ad-tabs { display: flex; gap: 2px; }
.ad-tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); min-height: 38px; display: inline-flex; align-items: center; gap: 6px; }
.ad-tabs button.active { background: var(--soft); color: var(--fg); font-weight: 700; }
.ad-login { display: flex; justify-content: center; padding: 60px 0; }
.login-card { width: min(380px, 100%); border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: var(--bg); display: grid; gap: 12px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.login-card input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; }
.ad-banner { background: #fff3d6; border: 1px solid #f0dca0; color: #7a4b00; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.ad-filters .ad-actions { margin-left: auto; }
.mst-pending td { background: #fffbe6; }
.od-list { display: grid; gap: 8px; }
.od-list .ord { background: var(--bg); }
.od-list .ord summary { grid-template-columns: auto auto auto auto 1fr; }
.od-list .osel { width: 18px; height: 18px; margin: 0; }
.od-list .od-addr { font-size: 13px; margin: 0 0 6px; }
.od-list .otrack { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; height: 36px; width: 170px; font-size: 13px; }
.od-list .hist-prod .thumb { width: 56px; height: 42px; }
#od-bulk { margin-bottom: 10px; }
.od-list .ord-sum { grid-column: auto; }
.od-list .ord-actions { align-items: center; }
.od-list .omemo { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; height: 36px; flex: 1; min-width: 200px; font-size: 13px; }
.od-list .ostatus { border: 1px solid var(--line); border-radius: 6px; height: 36px; padding: 0 8px; margin-left: 4px; }
.od-list .od-st { font-size: 13px; color: var(--muted); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.set-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.set-card h2 { margin: 0 0 8px; font-size: 16px; }
.set-card form { display: grid; gap: 8px; }
.set-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.set-card input[type=password] { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 15px; }
.set-card input[type=file] { font-size: 13px; }
.set-card .btn { justify-self: start; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.ad-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ad-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.ad-pills button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; min-height: 34px; }
.ad-pills button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ad-pills button small { opacity: .65; margin-left: 4px; }
.ad-filters input, .ad-filters select { border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 36px; font-size: 14px; background: var(--bg); }
.ad-filters input { width: 220px; }
.ad-count { font-size: 13px; color: var(--muted); margin-left: auto; }
.ad-bulk { display: flex; align-items: center; gap: 8px; background: #fff7e0; border: 1px solid #f0dca0; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; flex-wrap: wrap; }
.ad-bulk select { height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.ad-tablewrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 980px; }
.ad-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 8px; border-bottom: 1px solid var(--fg); white-space: nowrap; position: sticky; top: 0; background: var(--bg); }
.ad-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-table tr.dirty td { background: #fffbe6; }
.ad-table tr.st-단종 td { color: var(--muted); }
.ad-table img { width: 72px; height: 44px; object-fit: cover; border-radius: 4px; background: #f0f0f0; display: block; }
.ad-table .code { font-weight: 700; white-space: nowrap; }
.ad-table .en { color: var(--muted); font-size: 12px; }
.ad-table select, .ad-table input[type=text] { border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; height: 32px; font-size: 13px; background: var(--bg); }
.ad-table input[type=text] { width: 160px; }
.ad-table .st-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; color: #fff; margin-left: 4px; }
.ad-table .rm { border: 0; background: transparent; color: var(--fg); text-decoration: underline; cursor: pointer; font-size: 13px; }
.ad-table input[type=checkbox] { width: 18px; height: 18px; }
.ad-log { margin-top: 12px; background: #1e1e1e; color: #ddd; border-radius: 8px; padding: 12px 14px; font-size: 12px; white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; max-height: 260px; overflow: auto; }
.ad-log .warn { color: #f7c948; } .ad-log .err { color: #ff7b72; }

dialog#ad-dlg { border: 0; border-radius: 14px; padding: 0; width: min(760px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog#ad-dlg::backdrop { background: rgba(0,0,0,.45); }
#ad-form { padding: 16px 20px 18px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.dlg-grid label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 12px; color: var(--muted); align-content: flex-start; }   /* 라벨 글자와 '필수' 는 한 줄, 입력란은 다음 줄 */
.dlg-grid label > input, .dlg-grid label > select, .dlg-grid label > textarea { flex: 1 0 100%; width: 100%; min-width: 0; }
.dlg-grid .full { grid-column: 1 / -1; }
.dlg-grid input, .dlg-grid select, .dlg-grid textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 15px; color: var(--fg); background: var(--bg); }
.dlg-grid textarea { font-family: ui-monospace, Consolas, "Noto Sans KR", monospace; line-height: 1.5; }
.dlg-grid .req { color: var(--new); font-size: 11px; }
.rows-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.color-rows { display: grid; gap: 6px; }
.crow { display: grid; grid-template-columns: 30px 1fr 1fr auto 34px; gap: 6px; align-items: center; }
.crow .cno { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--fg); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.crow input[type=text] { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 15px; min-width: 0; }
.crow .coff { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.crow .coff input { width: 18px; height: 18px; margin: 0; }
.crow .cdel { border: 0; background: var(--soft); width: 30px; height: 30px; border-radius: 50%; font-size: 16px; color: var(--muted); }
.crow .cdel[hidden] { visibility: hidden; display: inline-block !important; }
.crow.off .cno { background: #8a8a8a; border-color: #8a8a8a; color: #fff; }
.crow.off input[type=text] { color: var(--muted); text-decoration: line-through; }
.rows-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.rows-foot .hint { margin-top: 0; }
.img-row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.img-prev { background: #f3f3f3; border-radius: 8px; min-height: 100px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.img-prev img { width: 100%; height: auto; display: block; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.dlg-grid label > .code-hint { flex: 1 0 100%; margin-top: 0; }
.code-hint.ok { color: var(--ok); }
.code-hint.warn { color: var(--warn); }
.code-hint.bad { color: var(--new); }
.code-hint .link { border: 0; background: none; padding: 0; margin-left: 4px; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.dlg-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.dlg-foot .spacer { flex: 1; }
@media (max-width: 640px) { .dlg-grid, .img-row { grid-template-columns: 1fr; } .ad-filters input { width: 100%; } }
