/* Pratidhi Foods — admin panel styles (extends style.css tokens) */

body.admin { background: #F4F0DF; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(800px 420px at 85% -5%, rgba(244,237,167,.9), transparent 60%),
    radial-gradient(600px 380px at 0% 110%, rgba(124,185,62,.15), transparent 60%),
    var(--paper);
}
.login-card {
  width: min(420px, 100%); background: var(--white);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift);
  padding: 42px 38px; position: relative;
}
.login-card::after {
  content: ""; position: absolute; inset: 9px; pointer-events: none;
  border: 1.5px solid rgba(168,35,28,.25); border-radius: 12px;
}
.login-card > * { position: relative; z-index: 1; }
.login-logo { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 16px; display: block; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.55rem; text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; font-size: .92rem; color: var(--ink-soft); margin-bottom: 26px; }
.login-error {
  display: none; background: #FBEAE8; color: var(--maroon-deep);
  border: 1px solid rgba(168,35,28,.3); border-radius: 10px;
  padding: 10px 14px; font-size: .9rem; font-weight: 700; margin-bottom: 16px;
}
.login-card .btn { width: 100%; margin-top: 6px; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: .9rem; font-weight: 700; }

/* ---------- Admin shell ---------- */
.admin-shell { display: none; min-height: 100vh; }
.admin-shell.is-active { display: block; }
.login-screen.is-hidden { display: none; }

.admin-bar {
  background: var(--maroon); color: var(--cream);
  position: sticky; top: 0; z-index: 40;
}
.admin-bar .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.admin-bar img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--cream); }
.admin-bar b { font-family: var(--font-display); font-size: 1.1rem; }
.admin-bar .spacer { margin-left: auto; display: flex; gap: 10px; }
.admin-bar .btn { padding: 8px 18px; font-size: .88rem; }
.admin-bar .btn--ghost { border-color: var(--cream); color: var(--cream); }
.admin-bar .btn--ghost:hover { background: var(--cream); color: var(--maroon-deep); }

.admin-tabs {
  background: var(--white); border-bottom: 1px solid var(--line);
  position: sticky; top: 64px; z-index: 39;
}
.admin-tabs .wrap { display: flex; gap: 4px; overflow-x: auto; }
.tab-btn {
  font: inherit; font-weight: 800; font-size: .95rem; letter-spacing: .01em;
  background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--ink-soft); padding: 15px 18px; cursor: pointer; white-space: nowrap;
}
.tab-btn:hover { color: var(--maroon); }
.tab-btn.is-active { color: var(--maroon); border-bottom-color: var(--maroon); }

.admin-main { padding: 36px 0 80px; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.admin-note {
  background: var(--cream-soft); border: 1.5px dashed rgba(168,35,28,.35);
  border-radius: 12px; padding: 14px 18px; font-size: .9rem; color: var(--ink-soft);
  margin-bottom: 28px;
}
.admin-note b { color: var(--maroon-ink); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.panel-head h2 { font-size: 1.5rem; }
.panel-head p { color: var(--ink-soft); font-size: .92rem; }

/* ---------- Item lists ---------- */
.admin-list { display: grid; gap: 14px; }
.admin-item {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px;
  display: grid; grid-template-columns: 86px 1fr auto; gap: 16px; align-items: center;
}
.admin-item img {
  width: 86px; height: 86px; object-fit: cover; border-radius: 10px;
  background: var(--cream-soft); border: 1px solid var(--line);
}
.admin-item .meta h3 { font-size: 1.02rem; margin-bottom: 2px; }
.admin-item .meta p { font-size: .85rem; color: var(--ink-soft); }
.admin-item .meta .chips { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: var(--cream); color: var(--maroon-deep); border-radius: 999px; padding: 3px 10px;
}
.chip--video { background: #E8F3DC; color: var(--leaf-deep); }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 9px; padding: 7px 12px; transition: .15s;
}
.icon-btn:hover { border-color: var(--maroon); color: var(--maroon); }
.icon-btn--danger:hover { border-color: var(--maroon); background: var(--maroon); color: var(--cream); }
.icon-btn--star.is-on { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ---------- Editor form ---------- */
.editor {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lift); padding: 28px; margin-bottom: 30px;
}
.editor h3 { margin-bottom: 18px; font-size: 1.2rem; }
.editor .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor .field { margin-bottom: 16px; }
.editor .field label { display: block; font-weight: 800; font-size: .84rem; margin-bottom: 5px; }
.editor .field input, .editor .field select, .editor .field textarea {
  width: 100%; font: inherit; padding: 11px 13px; border-radius: 9px;
  border: 1.5px solid var(--line); background: var(--paper);
}
.editor .field input:focus, .editor .field select:focus, .editor .field textarea:focus {
  border-color: var(--maroon); outline: none; box-shadow: 0 0 0 3px rgba(168,35,28,.12);
}
.editor .hint { font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }
.editor .actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.drop-zone {
  border: 2px dashed rgba(168,35,28,.4); border-radius: 12px;
  background: var(--cream-soft); padding: 22px; text-align: center;
  font-size: .92rem; color: var(--ink-soft); cursor: pointer; transition: .15s;
}
.drop-zone:hover, .drop-zone.is-drag { background: var(--cream); border-color: var(--maroon); }
.drop-zone b { color: var(--maroon); }
.drop-zone input { display: none; }
.upload-preview { margin-top: 12px; display: none; }
.upload-preview img { max-height: 140px; border-radius: 10px; border: 1px solid var(--line); margin-inline: auto; }

.radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.radio-row label { font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 7px; cursor: pointer; }

/* ---------- Toast + misc ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  background: var(--maroon-ink); color: var(--cream); font-weight: 700; font-size: .92rem;
  padding: 13px 24px; border-radius: 999px; box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 90;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--maroon); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.storage-meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 10px 0 6px; }
.storage-meter i { display: block; height: 100%; background: var(--leaf); border-radius: 999px; }
.storage-meter i.is-warn { background: var(--gold); }
.storage-meter i.is-full { background: var(--maroon); }

@media (max-width: 860px) {
  .editor .form-row, .settings-grid { grid-template-columns: 1fr; }
  .admin-item { grid-template-columns: 66px 1fr; }
  .admin-item img { width: 66px; height: 66px; }
  .item-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- v3 admin additions ---------- */
.step-hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFF; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; font-size: .88rem; color: var(--ink-soft); margin-bottom: 18px;
}
.step-hint b { color: var(--maroon-ink); }
.content-group { margin-bottom: 30px; }
.content-group h3 {
  font-size: 1.1rem; margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--cream);
}
.content-field { margin-bottom: 14px; }
.content-field label { display: block; font-weight: 800; font-size: .82rem; margin-bottom: 4px; }
.content-field .default-note { font-weight: 400; color: var(--ink-soft); font-size: .76rem; }
.content-field input, .content-field textarea {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 9px;
  border: 1.5px solid var(--line); background: var(--paper);
}
.content-field textarea { min-height: 74px; resize: vertical; }
.content-field input:focus, .content-field textarea:focus {
  border-color: var(--maroon); outline: none; box-shadow: 0 0 0 3px rgba(168,35,28,.12);
}
.content-field .ml-input { font-family: var(--font-ml); }
.content-field.is-changed input, .content-field.is-changed textarea { border-color: var(--gold); background: #FFFBEA; }
.save-bar {
  position: sticky; bottom: 0; z-index: 30;
  background: var(--white); border-top: 1px solid var(--line);
  padding: 14px 0; margin-top: 10px;
  display: flex; gap: 12px; align-items: center;
}
.save-bar .hint { margin-left: auto; }
.pill-ok { color: var(--leaf-deep); font-weight: 800; font-size: .9rem; }
