/* Admin styles — same palette and fonts as the public catalog site. */
:root {
  --bg: #f3ece2; --paper: #fffdf8; --ink: #201e1a; --muted: #6f665b; --line: #d9cdbd;
  --clay: #a6421d; --clay-dark: #7c371b; --clay-soft: #f6e2d4; --ok: #2f6b3a; --ok-soft: #e3f0e3;
  --warn: #8a5a00; --warn-soft: #fbefd2; --err: #a32020; --err-soft: #fbe3e1; --night: #1e1a16;
  --display: "Heebo", system-ui, sans-serif; --body: "Assistant", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.55; direction: rtl; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.shell { max-width: 1080px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 80px max(16px, env(safe-area-inset-left)); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-left: auto; }
.brand img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.brand strong { font-family: var(--display); font-weight: 800; font-size: 17px; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 13px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 0; background: var(--clay); color: #fffdf8; font-family: var(--display); font-weight: 700; font-size: 17px; text-decoration: none; transition: background .15s, transform .15s; }
.btn:hover { background: var(--clay-dark); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--clay); border: 2px solid var(--clay); }
.btn.ghost:hover { background: var(--clay-soft); }
.btn.quiet { background: transparent; color: var(--muted); min-height: 40px; padding: 0 12px; font-size: 15px; }
.btn.quiet:hover { color: var(--ink); background: var(--clay-soft); }
.btn.danger { background: transparent; color: var(--err); border: 2px solid var(--err); }
.btn.danger.solid { background: var(--err); color: #fff; }
.btn.big { min-height: 58px; font-size: 19px; padding: 0 30px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right)); background: var(--night); }
.login-card { width: min(420px, 100%); background: var(--paper); padding: 34px 28px; display: grid; gap: 18px; border-top: 5px solid var(--clay); }
.login-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.login-card h1 { font-size: 28px; font-weight: 900; }
.login-card p { margin: 0; color: var(--muted); }

/* fields */
.field { display: grid; gap: 6px; }
.field label { font-family: var(--display); font-weight: 700; font-size: 16px; }
.field .hint { color: var(--muted); font-size: 14px; font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line); background: var(--paper); font-size: 18px; border-radius: 0; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--clay); outline: none; box-shadow: 0 0 0 3px var(--clay-soft); }
.field.invalid input { border-color: var(--err); }
.field .err { color: var(--err); font-size: 15px; font-weight: 700; }
.price-input { position: relative; }
.price-input span { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* notices */
.notice { padding: 12px 16px; font-weight: 600; font-size: 16px; border-inline-start: 4px solid; }
.notice.err { background: var(--err-soft); border-color: var(--err); color: var(--err); }
.notice.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.notice.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.notice ul { margin: 6px 0 0; padding-inline-start: 20px; }

/* home */
.hero { margin: 24px 0 28px; background: var(--night); color: #fffdf8; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; padding: 28px; align-items: center; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; letter-spacing: -.03em; margin-bottom: 10px; }
.hero p { margin: 0; color: #d9cbb9; }
.hero .eyebrow { color: #e5a07e; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .08em; margin-bottom: 8px; }
.tutorial-slot { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #2b241e; border: 1px solid #4a3d31; display: grid; place-items: center; text-align: center; color: #bfae99; padding: 16px; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 40px; }
.action { display: grid; gap: 6px; align-content: start; text-align: start; padding: 26px; background: var(--paper); border: 2px solid var(--line); transition: border-color .15s, transform .15s; }
.action:hover { border-color: var(--clay); transform: translateY(-2px); }
.action .icon { width: 52px; height: 52px; display: grid; place-items: center; background: var(--clay-soft); color: var(--clay); font-size: 30px; font-weight: 900; margin-bottom: 8px; }
.action strong { font-family: var(--display); font-size: 22px; font-weight: 800; }
.action span { color: var(--muted); }
.action.primary { background: var(--clay); border-color: var(--clay); color: #fffdf8; }
.action.primary span { color: #f6dccb; }
.action.primary .icon { background: rgba(255,255,255,.18); color: #fff; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-size: 26px; font-weight: 800; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { flex: 1 1 240px; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); background: var(--paper); }
.chip { min-height: 40px; padding: 0 14px; border: 1.5px solid var(--line); background: var(--paper); font-family: var(--display); font-weight: 700; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* product cards (mirror the public site) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pcard { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--paper); text-align: start; overflow: hidden; transition: transform .15s, box-shadow .15s; }
button.pcard:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(61,41,24,.14); }
.pvisual { position: relative; aspect-ratio: 3 / 2; background: #e9dfd2 center / cover no-repeat; overflow: hidden; }
.pvisual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(26,18,12,.03), rgba(26,18,12,.5)); pointer-events: none; }
.pvisual .label { position: absolute; z-index: 1; top: 12px; left: 12px; color: #fffdf8; font-family: var(--display); font-weight: 700; font-size: 13px; }
.pbody { padding: 14px 16px 16px; display: grid; gap: 6px; }
.pbody h3 { font-size: 18px; font-weight: 800; }
.pbody p { margin: 0; color: var(--muted); font-size: 15px; }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 14px; }
.pmeta .price { color: var(--clay); font-family: var(--display); font-weight: 800; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed var(--line); }

/* wizard */
.wiz-head { display: flex; align-items: center; gap: 12px; margin: 24px 0 18px; flex-wrap: wrap; }
.wiz-head h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; margin-left: auto; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; background: var(--paper); border: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border: 0; border-bottom: 4px solid transparent; background: transparent; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--muted); text-align: start; }
.step .n { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); font-size: 15px; }
.step.done .n { background: var(--ok); color: #fff; }
.step.on { color: var(--clay); border-bottom-color: var(--clay); }
.step.on .n { background: var(--clay); color: #fff; }
.step[disabled] { cursor: default; }
.panel { background: var(--paper); border: 1px solid var(--line); padding: clamp(18px, 3vw, 32px); display: grid; gap: 20px; }
.panel > h2 { font-size: 24px; font-weight: 800; }
.panel > .lead { margin: -12px 0 0; color: var(--muted); }
.wiz-nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 20px; flex-wrap: wrap; }

/* upload + crop */
.drop { display: grid; place-items: center; gap: 10px; min-height: 240px; padding: 24px; border: 3px dashed var(--clay); background: var(--clay-soft); text-align: center; color: var(--clay-dark); }
.drop.over { background: #f0cdb7; }
.drop strong { font-family: var(--display); font-size: 22px; font-weight: 800; }
.crop-wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.crop-stage { display: grid; gap: 12px; }
.crop-frame { position: relative; aspect-ratio: 3 / 2; max-width: 100%; overflow: hidden; background: #2b241e; touch-action: none; cursor: grab; user-select: none; }
.crop-frame:active { cursor: grabbing; }
.crop-frame canvas { display: block; width: 100%; height: 100%; }
.crop-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(145deg, rgba(26,18,12,.03), rgba(26,18,12,.5)); }
.crop-frame .grid-lines { position: absolute; inset: 0; pointer-events: none; z-index: 1; background:
  linear-gradient(to right, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.6%, transparent 66.8%),
  linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.6%, transparent 66.8%); }
.crop-frame .label { position: absolute; z-index: 2; top: 12px; left: 12px; color: #fffdf8; font-family: var(--display); font-weight: 700; font-size: 13px; pointer-events: none; }
.zoom { display: flex; align-items: center; gap: 12px; }
.zoom input { flex: 1; accent-color: var(--clay); height: 30px; }
.zoom button { width: 44px; height: 44px; border: 1.5px solid var(--line); background: var(--paper); font-size: 22px; font-weight: 800; }
.crop-help { display: grid; gap: 10px; font-size: 16px; color: var(--muted); }
.crop-help ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.current-img { display: grid; gap: 12px; }

/* category step */
.cat-list { display: grid; gap: 10px; }
.cat-option { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 2px solid var(--line); background: var(--paper); text-align: start; width: 100%; }
.cat-option[aria-pressed="true"] { border-color: var(--clay); background: var(--clay-soft); }
.cat-option .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); margin-top: 3px; }
.cat-option[aria-pressed="true"] .dot { border: 7px solid var(--clay); }
.cat-option strong { font-family: var(--display); font-size: 18px; display: block; }
.cat-option span { color: var(--muted); font-size: 15px; }
.subs { display: flex; flex-wrap: wrap; gap: 10px; }
.subs .chip { min-height: 48px; font-size: 16px; padding: 0 18px; }

/* confirm */
.confirm { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
.summary { display: grid; gap: 0; border-top: 1px solid var(--line); }
.summary div { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--muted); font-weight: 700; font-size: 15px; }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.summary .edit-link { border: 0; background: none; color: var(--clay); font-weight: 700; font-size: 15px; text-decoration: underline; }
.changed { background: var(--warn-soft); padding: 0 6px; }

/* overlay */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20,14,10,.7); display: grid; place-items: center; padding: 20px; }
.dialog { width: min(460px, 100%); background: var(--paper); padding: 28px; display: grid; gap: 16px; border-top: 5px solid var(--clay); }
.dialog h2 { font-size: 24px; font-weight: 800; }
.dialog p { margin: 0; color: var(--muted); }
.dialog .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
.spinner { width: 46px; height: 46px; border: 5px solid var(--clay-soft); border-top-color: var(--clay); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 900; }

@media (max-width: 820px) {
  .hero, .crop-wrap, .confirm { grid-template-columns: minmax(0, 1fr); }
  .actions { grid-template-columns: minmax(0, 1fr); }
  .step { flex-direction: column; text-align: center; gap: 4px; font-size: 13px; padding: 10px 4px; }
}
@media (max-width: 520px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .summary div { grid-template-columns: 100px minmax(0, 1fr) auto; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
