/* ============================================================
   K1 PROJECT — admin
   ============================================================ */

:root{
  color-scheme: light;
  --paper:#F7F4ED; --card:#FFFDF8; --band:#EFE9DE;
  --ink:#1A1714; --ink2:#574E45; --ink3:#8B8073;
  --rule:#DCD3C4; --rule2:#E9E2D6;
  --accent:#9C3C20; --good:#3F6B44; --warn:#8A6A1F;
  --ui:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",sans-serif;
  --read:"Spectral","Nanum Myeongjo",Georgia,serif;
  --ease:cubic-bezier(.22,.61,.36,1);
  --r:10px;
}
*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; }
body{
  background:var(--paper); color:var(--ink);
  font:15px/1.6 var(--ui);
  -webkit-font-smoothing:antialiased;
}
img{ display:block; max-width:100%; }
a{ color:var(--accent); }
[hidden]{ display:none !important; }

button,input,textarea,select{ font:inherit; color:inherit; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--ink); color:var(--paper); border:1px solid var(--ink);
  border-radius:999px; padding:10px 20px; cursor:pointer;
  font-size:13px; font-weight:500; letter-spacing:.02em;
  transition:background .25s var(--ease), color .25s var(--ease), opacity .25s;
}
.btn:hover{ background:#000; }
.btn.ghost{ background:transparent; color:var(--ink); border-color:var(--rule); }
.btn.ghost:hover{ background:var(--band); }
.btn.sm{ padding:7px 14px; font-size:12px; }
.btn.tiny{ padding:4px 9px; font-size:11px; border-radius:7px; }
.btn.danger{ color:var(--accent); border-color:#E3CCC3; background:transparent; }
.btn.danger:hover{ background:#F6E7E1; }
.btn[disabled]{ opacity:.4; cursor:not-allowed; }
.btn.pub{ background:var(--accent); border-color:var(--accent); }
.btn.pub:hover{ background:#832F17; }

/* ---------- auth ---------- */
.auth-page{ display:grid; place-items:center; min-height:100vh; padding:24px; }
.auth-card{
  width:100%; max-width:380px; background:var(--card);
  border:1px solid var(--rule); border-radius:16px; padding:34px 32px 30px;
  box-shadow:0 30px 60px -40px rgba(40,26,14,.4);
}
.auth-card.wide{ max-width:560px; }
.auth-logo{ height:15px; width:auto; margin-bottom:26px; }
.auth-card h1{ font-size:20px; font-weight:500; margin:0 0 6px; letter-spacing:-.01em; }
.auth-card h2{ font-size:13px; font-weight:500; margin:0 0 10px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink3); }
.auth-card label{ display:block; margin:18px 0 0; font-size:12px; color:var(--ink2); }
.auth-card input{
  display:block; width:100%; margin-top:6px; padding:11px 13px;
  background:#fff; border:1px solid var(--rule); border-radius:9px;
}
.auth-card .btn{ margin-top:20px; width:100%; }
.muted{ color:var(--ink3); }
.small{ font-size:12.5px; }
.mt{ margin-top:26px; }
.err{ color:var(--accent); font-size:13px; margin:14px 0 0; }
.checks{ width:100%; border-collapse:collapse; font-size:13px; }
.checks td{ padding:7px 0; border-bottom:1px solid var(--rule2); }
.checks td:nth-child(2){ color:var(--ink3); text-align:right; padding-right:12px; }
.checks td:last-child{ width:20px; text-align:right; }
.checks tr.good td:last-child{ color:var(--good); }
.checks tr.bad td:last-child{ color:var(--accent); }

/* ---------- top bar ---------- */
.bar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; gap:18px; flex-wrap:wrap;
  padding:12px 22px;
  background:rgba(247,244,237,.93); backdrop-filter:blur(12px);
  border-bottom:1px solid var(--rule);
}
.bar-logo img{ height:13px; width:auto; }
.tabs{ display:flex; gap:2px; flex:1 1 auto; }
.tab{
  border:0; background:none; cursor:pointer; padding:8px 14px; border-radius:8px;
  font-size:13px; color:var(--ink2);
}
.tab:hover{ background:var(--band); }
.tab.on{ background:var(--ink); color:var(--paper); }
.bar-right{ display:flex; align-items:center; gap:8px; }
.status{ font-size:11.5px; color:var(--ink3); min-width:74px; text-align:right; }
.status.ok{ color:var(--good); }
.status.bad{ color:var(--accent); }

.dirtybar{
  position:sticky; top:53px; z-index:35;
  display:flex; gap:16px; align-items:center; justify-content:space-between;
  padding:9px 22px; background:#F3E7C8; border-bottom:1px solid #E4D3AA;
  font-size:12.5px; color:#6B5417;
}
.dirtybar a{ color:#6B5417; font-weight:500; }

/* ---------- panes ---------- */
.panes{ max-width:1080px; margin:0 auto; padding:30px 22px 140px; }
.pane{ display:none; }
.pane.on{ display:block; }

.sec{
  background:var(--card); border:1px solid var(--rule); border-radius:var(--r);
  padding:22px 24px; margin-bottom:18px;
}
.sec > h2{
  font-size:11px; font-weight:500; letter-spacing:.18em; text-transform:uppercase;
  color:var(--ink3); margin:0 0 4px;
}
.sec > .hint{ font-size:12.5px; color:var(--ink3); margin:0 0 18px; max-width:62ch; }

/* bilingual field */
.f{ margin-bottom:16px; }
.f > label{ display:block; font-size:12px; color:var(--ink2); margin-bottom:6px; }
.bi{ display:grid; gap:10px; grid-template-columns:1fr; }
@media (min-width:820px){ .bi{ grid-template-columns:1fr 1fr; } }
.bi .lang{ position:relative; }
.bi .lang::after{
  content:attr(data-l); position:absolute; top:8px; right:10px;
  font-size:9px; letter-spacing:.14em; color:var(--ink3); pointer-events:none;
}
input[type=text], input[type=date], textarea, select{
  width:100%; padding:10px 42px 10px 12px;
  background:#fff; border:1px solid var(--rule); border-radius:8px;
  transition:border-color .2s;
}
input[type=text]:focus, textarea:focus, select:focus{ border-color:var(--ink3); }
textarea{ resize:vertical; min-height:74px; line-height:1.65; font-family:var(--read); font-size:14.5px; }
textarea.body{ min-height:240px; }
.row2{ display:grid; gap:10px; grid-template-columns:1fr 1fr; }
.row-y{ display:grid; gap:10px; grid-template-columns:130px 1fr; align-items:start; }

/* ---------- list rows ---------- */
.list{ border-top:1px solid var(--rule2); }
.item{ border-bottom:1px solid var(--rule2); }
.item.hiddenItem .sum-t{ text-decoration:line-through; color:var(--ink3); }
.sum{
  display:flex; align-items:center; gap:14px; padding:10px 4px;
  cursor:pointer; user-select:none;
}
.sum:hover{ background:var(--band); }
.sum-n{ font-size:11px; color:var(--ink3); width:26px; flex:0 0 auto; }
.sum-th{
  width:62px; height:44px; flex:0 0 auto; border-radius:5px; overflow:hidden;
  background:#fff; border:1px solid var(--rule2);
}
.sum-th img{ width:100%; height:100%; object-fit:contain; }
.sum-t{ flex:1 1 auto; font-size:14px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sum-d{ font-size:11.5px; color:var(--ink3); flex:0 0 auto; }
.sum-c{ display:flex; gap:4px; flex:0 0 auto; }
.ic{
  border:1px solid var(--rule); background:#fff; border-radius:7px;
  width:28px; height:28px; display:grid; place-items:center; cursor:pointer;
  font-size:13px; color:var(--ink2); line-height:1;
}
.ic:hover{ background:var(--band); }
.ic[disabled]{ opacity:.3; cursor:not-allowed; }
.body-open{ padding:6px 4px 22px; }
.item:not(.open) .body-open{ display:none; }

.pills{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:18px; }
.pill{
  border:1px solid var(--rule); background:#fff; border-radius:999px;
  padding:7px 15px; font-size:12.5px; cursor:pointer; color:var(--ink2);
}
.pill:hover{ background:var(--band); }
.pill.on{ background:var(--ink); color:var(--paper); border-color:var(--ink); }
.pill .n{ opacity:.55; margin-left:6px; font-size:11px; }

/* ---------- upload ---------- */
.drop{
  border:1.5px dashed var(--rule); border-radius:var(--r);
  padding:22px; text-align:center; background:#fff;
  margin-bottom:18px; transition:border-color .2s, background .2s;
}
.drop.over{ border-color:var(--accent); background:#FBF2EE; }
.drop p{ margin:0 0 10px; font-size:13px; color:var(--ink2); }
.drop .opts{ font-size:12px; color:var(--ink3); margin-top:12px; display:flex; gap:16px; justify-content:center; align-items:center; flex-wrap:wrap; }
.drop label.chk{ display:inline-flex; align-items:center; gap:7px; cursor:pointer; }
.drop input[type=checkbox]{ width:15px; height:15px; }
.prog{ font-size:12px; color:var(--ink3); margin-top:10px; }

/* ---------- misc ---------- */
.rowbtns{ display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.chkline{ display:inline-flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink2); cursor:pointer; }
.backup{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:9px 0; border-bottom:1px solid var(--rule2); font-size:13px; }
.kv{ display:grid; grid-template-columns:auto 1fr; gap:6px 18px; font-size:13px; color:var(--ink2); }
.kv dt{ color:var(--ink3); }
.kv dd{ margin:0; }
.note{ background:var(--band); border-radius:8px; padding:12px 14px; font-size:12.5px; color:var(--ink2); }

.toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%);
  background:var(--ink); color:var(--paper); padding:12px 20px; border-radius:999px;
  font-size:13px; z-index:200; box-shadow:0 18px 40px -20px rgba(0,0,0,.6);
  max-width:calc(100vw - 40px);
}
.toast.bad{ background:var(--accent); }

@media (max-width:700px){
  .bar{ padding:10px 14px; gap:10px; }
  .tabs{ order:3; width:100%; overflow-x:auto; }
  .panes{ padding:20px 14px 120px; }
  .sec{ padding:18px 16px; }
  .sum-th{ display:none; }
  .row2,.row-y{ grid-template-columns:1fr; }
}
