/* =========================================================
   dodo_baku — admin panel
   ========================================================= */
body.admin { background: var(--paper); cursor: auto; }
[hidden] { display: none !important; }

/* ---------- Auth ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse at 30% 20%, #3a3733, var(--ink) 70%);
  color: var(--bone);
}
.auth__card { width: min(420px, 100%); }
.auth__logo { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 64px; line-height: 1; text-align: center; }
.auth__eyebrow { text-align: center; color: var(--mist); margin: 14px 0 48px; }
.auth .field__label { color: var(--mist); }
.auth input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(233, 228, 220, 0.35);
  color: var(--cream);
  padding: 12px 0;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}
.auth input:focus { border-color: var(--cream); }
.auth__btn { width: 100%; justify-content: center; margin-top: 18px; }
.auth__note { color: var(--mist); font-size: 14px; margin: 0 0 24px; }
.auth__error { min-height: 22px; color: #e8b4a6; font-size: 13px; margin: 16px 0 0; text-align: center; }
.auth__back { display: block; text-align: center; margin-top: 30px; font-size: 12px; color: var(--stone); letter-spacing: 0.06em; }
.auth__back:hover { color: var(--bone); }

/* ---------- Dashboard ---------- */
.dash__top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 20px var(--gutter);
  background: rgba(243, 239, 232, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.dash__top .logo { font-size: 28px; }
.dash__tag { color: var(--stone); padding: 4px 10px; border: 1px solid var(--line); }
.dash__top-right { margin-left: auto; display: flex; gap: 28px; align-items: center; }
.dash__main { padding: 56px var(--gutter) 120px; max-width: 1400px; margin: 0 auto; }
.dash__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.dash__title { font-size: clamp(48px, 6vw, 84px); margin: 8px 0 0; }
.dash__count { font-family: var(--sans); font-style: normal; font-size: 16px; color: var(--stone); vertical-align: super; letter-spacing: 0.1em; }
.dash__tools { display: flex; gap: 12px; margin: 40px 0 28px; flex-wrap: wrap; }
.tool-input {
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 12px 14px;
  font-size: 14px;
  min-width: 190px;
  outline: none;
}
.tool-input:focus { border-color: var(--ink); }
#q { flex: 1; min-width: 220px; }

.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 20px; }
.pcard { position: relative; background: var(--cream); border: 1px solid var(--line); display: flex; flex-direction: column; transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease); }
.pcard:hover { box-shadow: 0 18px 40px -24px rgba(22, 21, 19, 0.35); transform: translateY(-2px); }
.pcard__img { aspect-ratio: 3 / 4; background: #d9d3ca center / cover no-repeat; position: relative; }
.pcard__img--none { display: grid; place-items: center; color: var(--stone); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.pcard__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; padding: 5px 8px; background: rgba(22, 21, 19, 0.82); color: var(--cream); }
.badge--light { background: rgba(250, 246, 239, 0.92); color: var(--ink); }
.pcard__body { padding: 16px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.pcard__name { font-family: var(--serif); font-size: 21px; line-height: 1.2; margin: 0; }
.pcard__meta { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--stone); margin-top: 6px; }
.pcard__row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 16px; }
.pcard__price { font-size: 14px; }
.pcard__actions { display: flex; gap: 16px; }
.pcard__actions button { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stone); }
.pcard__actions button:hover { color: var(--ink); }
.pcard__actions .del:hover { color: #a3402c; }
.plist__empty { color: var(--stone); padding: 60px 0; text-align: center; }

/* ---------- Editor ---------- */
#scrim { z-index: 40; }
.editor {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(640px, 100vw);
  background: var(--paper);
  transform: translateX(100%);
  transition: transform 0.7s var(--ease);
  box-shadow: -30px 0 60px -40px rgba(0, 0, 0, 0.4);
}
.editor.is-open { transform: none; }
.editor form { height: 100%; display: flex; flex-direction: column; }
.editor__head { display: flex; justify-content: space-between; align-items: center; padding: 26px 36px; border-bottom: 1px solid var(--line); }
.editor__head h2 { margin: 0; font-size: 38px; }
.editor__body { flex: 1; overflow: auto; padding: 28px 36px 40px; }
.editor__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 36px; border-top: 1px solid var(--line); background: var(--cream); }
.editor__foot .btn { margin-left: auto; }

.field { display: block; margin-bottom: 26px; }
.field__label { display: block; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--stone); margin-bottom: 10px; }
.field__label em { font-style: normal; letter-spacing: 0.04em; text-transform: none; color: var(--mist); }
.editor input[type="text"], .editor input[type="number"], .editor select, .editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s;
  border-radius: 0;
}
.editor textarea { resize: vertical; line-height: 1.6; font-family: var(--sans); font-weight: 300; }
.editor input:focus, .editor select:focus, .editor textarea:focus { border-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: end; }
.field-row .field { margin-bottom: 26px; }
.check { display: flex; align-items: center; gap: 12px; margin-bottom: 38px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { padding: 12px 22px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stone); transition: background 0.3s, color 0.3s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.is-on { background: var(--ink); color: var(--cream); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 20px; }
.chip { min-width: 48px; padding: 9px 12px; border: 1px solid var(--line); font-size: 13px; color: var(--stone); background: var(--cream); transition: all 0.25s; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chips__none { font-size: 13px; color: var(--mist); }
.size-add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.size-add input { flex: 1; min-width: 160px; padding: 10px 12px !important; font-size: 14px !important; }
.size-add button { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; padding: 0 14px; border: 1px solid var(--line); background: var(--cream); }
.size-add button:hover { border-color: var(--ink); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 10px; }
.photo { position: relative; aspect-ratio: 3 / 4; background: #d9d3ca center / cover no-repeat; border: 1px solid var(--line); }
.photo__label { position: absolute; left: 6px; top: 6px; font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; background: rgba(22, 21, 19, 0.8); color: var(--cream); padding: 3px 6px; }
.photo__tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; background: rgba(250, 246, 239, 0.92); }
.photo__tools button { flex: 1; padding: 6px 0; font-size: 13px; color: var(--ink); }
.photo__tools button:hover { background: var(--bone); }
.photo__tools button:disabled { opacity: 0.25; pointer-events: none; }
.photo--loading { display: grid; place-items: center; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stone); }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 26px 16px;
  border: 1px dashed rgba(22, 21, 19, 0.3);
  background: var(--cream);
  cursor: pointer;
  text-align: center;
  transition: background 0.3s, border-color 0.3s;
}
.drop:hover, .drop.is-over { background: var(--bone); border-color: var(--ink); }
.drop__big { font-family: var(--serif); font-style: italic; font-size: 24px; }
.drop__small { font-size: 12px; color: var(--stone); }
.upload-status { font-size: 12px; color: var(--stone); min-height: 18px; margin-top: 8px; }

.form-error { color: #a3402c; font-size: 14px; min-height: 20px; margin: 0; }
.danger { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #a3402c; }
.danger:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .editor__head, .editor__body, .editor__foot { padding-left: 20px; padding-right: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .dash__top-right { gap: 16px; }
  .dash__tag { display: none; }
}
