:root {
  --ink: #1d1b18; --ink-2: #4a453e; --mute: #8e877c; --line: #e8e2d8;
  --ivory: #f9f6f1; --gold: #b8996a; --gold-d: #957a4f; --gold-l: #efe6d6;
  --red: #a84a3a;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); font-size: 14.5px; color: var(--ink); background: var(--ivory); -webkit-font-smoothing: antialiased; word-break: keep-all; }
a { color: inherit; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }

.ad { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.ad__side { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; }
.ad__logo { display: block; font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 21px; letter-spacing: .26em; text-decoration: none; padding: 0 10px 28px; }
.ad__logo small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .2em; color: var(--gold-d); margin-top: 6px; }
.ad__nav { display: grid; gap: 2px; }
.ad__nav a { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); }
.ad__nav a:hover { background: var(--ivory); }
.ad__nav a.is-on { background: var(--ink); color: #fff; }
.ad__badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--gold-d); color: #fff; font-size: 12px; display: grid; place-items: center; }
.ad__side-foot { margin-top: auto; display: grid; gap: 8px; padding: 0 12px; font-size: 13px; color: var(--mute); }
.ad__side-foot a { text-decoration: none; }
.ad__side-foot button { background: none; border: 0; padding: 0; color: var(--mute); cursor: pointer; text-align: left; }
.ad__side-foot a:hover, .ad__side-foot button:hover { color: var(--ink); }

.ad__main { padding: 40px clamp(18px, 4vw, 56px) 80px; max-width: 1180px; width: 100%; }
.ad__title { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 24px; }

.toast { position: fixed; top: 20px; right: 20px; z-index: 50; background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); transition: opacity .5s, transform .5s; }
.toast.is-hide { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.alert { background: #fbf1ec; color: var(--red); padding: 13px 16px; border-radius: 10px; margin-bottom: 20px; line-height: 1.6; }
.alert a { font-weight: 600; }
.muted { color: var(--mute); }
.hint { color: var(--mute); font-size: 13px; line-height: 1.7; margin: 0 0 16px; }
.hint b { color: var(--gold-d); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: clamp(18px, 3vw, 30px); margin-bottom: 20px; }
.panel__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel__head h2 { font-size: 16px; font-weight: 600; }
.panel__head a { font-size: 13px; color: var(--mute); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; text-decoration: none; display: grid; gap: 4px; transition: border-color .2s; }
.stat:hover { border-color: var(--gold); }
.stat span { font-size: 13px; color: var(--mute); }
.stat b { font-size: 30px; font-weight: 600; }
.stat small { color: var(--mute); font-size: 12px; }
.stat:first-child b { color: var(--gold-d); }
.quick, .bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

/* Buttons */
.b { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; cursor: pointer; font-weight: 500; white-space: nowrap; transition: all .2s; }
.b:hover { border-color: var(--ink-2); }
.b--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.b--dark:hover { background: var(--gold-d); border-color: var(--gold-d); }
.b--danger { color: var(--red); border-color: #ecd3cc; background: #fff; }
.b--danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.b--full { width: 100%; }
.mini { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; cursor: pointer; text-decoration: none; }
.mini:hover:not(:disabled) { border-color: var(--ink-2); }
.mini:disabled { opacity: .35; cursor: default; }
.mini--danger { color: var(--red); }

/* Forms */
.f { display: block; margin-bottom: 18px; min-width: 0; }
.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.f small { display: block; margin-top: 6px; color: var(--mute); font-size: 12px; }
.f input, .f select, .f textarea, .cats input {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.f textarea { resize: vertical; line-height: 1.7; }
.f input:focus, .f select:focus, .f textarea:focus, .cats input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-l); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.pair { display: grid; grid-template-columns: 110px 1fr; gap: 0 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 4px 0 22px; }
.checks label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.checks input { width: 17px; height: 17px; accent-color: var(--gold-d); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.sticky-actions { position: sticky; bottom: 16px; z-index: 5; margin-bottom: 20px; }
.sticky-actions .b { box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.danger-zone { margin-top: 28px; display: flex; justify-content: flex-end; }

.chips { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 9px 18px; border: 1px solid var(--line); border-radius: 22px; cursor: pointer; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Drop zone */
.drop { position: relative; border: 1.5px dashed #d6ccbb; border-radius: 12px; background: var(--ivory); padding: 26px; text-align: center; transition: all .2s; }
.drop.is-over { border-color: var(--gold-d); background: var(--gold-l); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop__msg b { display: block; font-size: 15px; margin-bottom: 4px; }
.drop__msg span { color: var(--mute); font-size: 13px; }
.drop__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 0; }
.drop__list:not(:empty) { margin-top: 18px; }
.drop__list img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.drop__count { grid-column: 1 / -1; font-size: 13px; color: var(--gold-d); font-weight: 600; }

/* Photo manager */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ph-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.ph-card.is-cover { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-l); }
.ph-card__img { position: relative; cursor: crosshair; background: #f2ede4; }
.ph-card__img img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.ph-card__dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.3); background: rgba(184,153,106,.65); pointer-events: none; transition: left .15s, top .15s; }
.ph-card__tag { position: absolute; top: 8px; left: 8px; background: var(--gold-d); color: #fff; font-size: 11.5px; padding: 3px 9px; border-radius: 12px; }
.ph-card__prev { display: flex; gap: 6px; padding: 10px 10px 0; align-items: flex-end; }
.ph-card__prev span { display: block; overflow: hidden; border-radius: 4px; background: #f2ede4; }
.ph-card__prev span:first-child { width: 34%; }
.ph-card__prev span:last-child { flex: 1; }
.ph-card__prev img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-card__acts { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px; }
.ph-card__acts .mini--danger { margin-left: auto; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.panel .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--mute); padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: #fcfaf7; }
.table td a { text-decoration: none; font-weight: 500; }
.table td small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.thumb { width: 72px; }
.thumb img, .thumb span { display: block; width: 52px; height: 65px; object-fit: cover; border-radius: 6px; background: #f2ede4; }
.st { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 12px; background: #f1eee9; color: var(--mute); white-space: nowrap; }
.st--new { background: #fbeee8; color: var(--red); }
.st--progress { background: #eef2f8; color: #3d5a80; }
.st--done { background: #edf4ee; color: #3e7349; }
.st--gold { background: var(--gold-l); color: var(--gold-d); }
.empty-box { background: #fff; border: 1px dashed #d6ccbb; border-radius: 14px; padding: 56px 20px; text-align: center; color: var(--mute); display: grid; gap: 16px; justify-items: center; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { display: inline-flex; gap: 8px; align-items: center; padding: 9px 16px; border-radius: 20px; border: 1px solid var(--line); background: #fff; text-decoration: none; }
.tab b { font-weight: 600; color: var(--gold-d); }
.tab.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab.is-on b { color: var(--gold-l); }

.dl { margin: 0; }
.dl div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl div:last-child { border-bottom: 0; }
.dl dt { color: var(--mute); font-size: 13px; }
.dl dd { margin: 0; line-height: 1.7; }

.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li { display: flex; gap: 20px; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rlist li:last-child { border-bottom: 0; }
.rlist p { line-height: 1.7; margin-bottom: 6px; }
.rlist small { color: var(--mute); }
.rlist__acts { display: flex; gap: 6px; align-items: flex-start; flex: none; }
.rlist__acts form { margin: 0; }

.brand { display: flex; gap: 22px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.brand:last-child { border-bottom: 0; padding-bottom: 0; }
.brand:first-of-type { padding-top: 0; }
.brand__prev { flex: none; width: 200px; height: 96px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px; }
.brand__prev--icon { width: 96px; }
.brand__prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand__prev span { font-family: 'Cormorant Garamond', serif; font-size: 15px; letter-spacing: .2em; color: var(--mute); text-align: center; }
.brand__body { flex: 1; min-width: 0; }
.brand__body h3 { margin: 0 0 4px; font-size: 14.5px; }
.brand__body .hint { margin-bottom: 10px; }
.brand__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.brand__form input[type="file"] { flex: 1; min-width: 0; font-size: 13px; }
.brand form:last-child { margin: 0; }

.kakao__state { margin: 0 0 14px; font-weight: 600; color: var(--mute); }
.kakao__state--on { color: #2f7a4b; }
.kakao__state small { font-weight: 400; color: var(--mute); margin-left: 6px; }
#kakao .actions { align-items: center; }
#kakao form { margin: 0; }
.kakao__btn { background: #fee500; border-color: #fee500; color: #191919; }
.kakao__btn:hover { background: #f5dc00; border-color: #f5dc00; }

.cats { display: grid; gap: 8px; }
.cats__row { display: grid; grid-template-columns: 1.2fr 1.2fr 1.2fr 80px 64px; gap: 8px; align-items: center; }
.cats__row--head span { font-size: 12.5px; color: var(--mute); }
.cats__row--new input { border-style: dashed; }
.cats .actions { margin-top: 10px; }

/* Busy overlay */
.busy { position: fixed; inset: 0; z-index: 90; background: rgba(255,255,255,.88); display: none; place-items: center; text-align: center; }
.busy.is-on { display: grid; }
.busy p { margin-top: 18px; color: var(--ink-2); }
.spin { display: inline-block; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold-l); border-top-color: var(--gold-d); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login__box { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px 32px; }
.login__box .ad__logo { text-align: center; padding: 0 0 28px; }
.login__back { display: block; text-align: center; margin-top: 20px; font-size: 13px; color: var(--mute); text-decoration: none; }

@media (max-width: 900px) {
  .ad { grid-template-columns: 1fr; }
  .ad__side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .ad__side::-webkit-scrollbar { display: none; }
  .ad__logo { padding: 0 8px 0 0; font-size: 16px; flex: none; }
  .ad__logo small { display: none; }
  .ad__nav { display: flex; gap: 4px; }
  .ad__nav a { white-space: nowrap; padding: 8px 11px; gap: 6px; }
  .ad__side-foot { display: flex; margin: 0; flex: none; white-space: nowrap; padding: 0 0 0 6px; gap: 12px; }
  .ad__main { padding-top: 24px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cats__row { grid-template-columns: 1fr 1fr; }
  .cats__row--head { display: none; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .brand { flex-direction: column; }
}
