/* Admin panel — layered on top of site.css (reuses its variables, buttons, forms, tables). */

/* Match the public site's warm background + subtle pattern watermark (the pattern itself
   comes from the shared `body::before` rule in site.css, which already applies here too —
   this just makes the base color match instead of the slightly darker --ivory tone). */
body.admin-body { display: block; background: var(--bg-warm); }

.admin-shell { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.admin-sidebar { width: 260px; flex: none; background: var(--green); color: rgba(255,255,255,.88); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar__brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.1); color: #fff; }
.admin-sidebar__brand strong { font-size: .95rem; line-height: 1.3; display: block; }
.admin-sidebar__brand small { color: rgba(255,255,255,.6); font-size: .75rem; }
.admin-nav { padding: .8rem; flex: 1; }
.admin-nav__group { margin-bottom: .3rem; }
.admin-nav__head { padding: .7rem .7rem .3rem; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.admin-nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: 10px; color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 600; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.is-active { background: var(--gold); color: var(--ink); }
.admin-nav a svg { flex: none; opacity: .85; }
.admin-nav a.is-active svg { opacity: 1; }

/* ---------- topbar + main ---------- */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: .9rem 1.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 20; }
.admin-topbar h1 { margin: 0; font-size: 1.15rem; }
.admin-topbar__tools { display: flex; align-items: center; gap: .9rem; }
.admin-topbar__lang a { font-size: .85rem; padding: .3rem .6rem; border-radius: 8px; }
.admin-topbar__lang a.is-active { background: var(--gold-soft); color: var(--gold-2); font-weight: 700; }
.admin-content { padding: 1.6rem; flex: 1; }
.admin-user { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; }
.admin-user .avatar { width: 32px; height: 32px; font-size: .95rem; }

/* ---------- toolbars / cards ---------- */
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.admin-toolbar h2 { margin: 0; font-size: 1.25rem; }
.admin-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: 1.4rem; }
.admin-card h3 { margin-top: 0; }

/* ---------- language tabs on forms ---------- */
.lang-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line-soft); }
.lang-tabs button { background: none; border: 0; padding: .6rem 1rem; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; font-size: .92rem; }
.lang-tabs button.is-active { color: var(--gold-2); border-color: var(--gold); }
.lang-pane[hidden] { display: none; }

/* ---------- data table extras ---------- */
.data-table img.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.data-table td.actions, .data-table th.actions { text-align: end; white-space: nowrap; }
.table-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; color: var(--muted); }
.icon-link:hover { background: var(--gold-soft); color: var(--gold-2); }
.icon-link--danger:hover { background: #fbe6e6; color: var(--err); }
.gallery-manage { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0 .8rem; }
.gallery-manage__item { position: relative; width: 84px; }
.gallery-manage__item img, .gallery-manage__item video { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; background: #111; }
.gallery-manage__item form { position: absolute; top: -8px; inset-inline-end: -8px; margin: 0; }
.gallery-manage__item .icon-link { width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge--gray { background: #eee; color: #555; }
.badge--gold { background: var(--gold-soft); color: var(--gold-2); }
.badge--ok { background: #e2f2ee; color: var(--ok); }
.badge--warn { background: #fbf1de; color: var(--warn); }
.badge--err { background: #fbe6e6; color: var(--err); }
.badge--info { background: #e4eef4; color: var(--info); }

/* ---------- image upload widget ---------- */
.img-field { display: flex; align-items: center; gap: 1rem; }
.img-field__preview { width: 74px; height: 74px; border-radius: 10px; background: var(--ivory); object-fit: cover; flex: none; border: 1px solid var(--line-soft); }
.img-field__preview--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .7rem; }

/* ---------- repeater (steps, requirements, links, pricing) ---------- */
.repeater { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; margin-bottom: .6rem; }
.repeater__row { display: flex; gap: .8rem; padding: .8rem; align-items: flex-start; border-bottom: 1px solid var(--line-soft); background: #fff; }
.repeater__row:last-child { border-bottom: 0; }
.repeater__row .field { margin-bottom: 0; flex: 1; }
.repeater__remove { flex: none; background: none; border: 0; color: var(--err); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: .3rem .5rem; }
.repeater__add { margin-top: .4rem; }

/* ---------- login ---------- */
/* ---------- login (split screen: form left, brand panel right) ---------- */
.admin-login { min-height: 100vh; display: flex; background: var(--bg-warm); }
.admin-login__form-side { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 2.4rem 1.6rem; order: 2; }
.admin-login__card { width: 100%; max-width: 420px; }
.admin-login__badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--gold-soft); color: var(--gold-2); font-size: .78rem; font-weight: 700; padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.1rem; }
.admin-login__card h1 { font-size: 1.7rem; margin: 0 0 .35rem; }
.admin-login__card .sub { color: var(--muted); margin: 0 0 1.6rem; }
.admin-login__field-icon { position: relative; }
.admin-login__field-icon input { padding-inline-end: 2.6rem; }
.admin-login__field-icon .icon-link { position: absolute; top: 50%; inset-inline-end: .3rem; transform: translateY(-50%); pointer-events: none; }
.admin-login__field-icon button.icon-link { pointer-events: auto; background: none; border: 0; }
.admin-login__footer { text-align: center; margin-top: 1.6rem; color: var(--muted); font-size: .82rem; }
.admin-login__brand-panel { flex: 1 1 480px; order: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2.6rem 3rem; color: #fff; background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 55%, #191919 130%); }
@media (max-width: 900px) { .admin-login__brand-panel { display: none; } }
.admin-login__panel-top { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; }
.admin-login__panel-top strong { font-size: 1.1rem; font-weight: 800; }
.admin-login__panel-top .icon-box { width: 42px; height: 42px; border-radius: 10px; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; flex: none; }
.admin-login__panel-top .icon-box img { height: 24px; width: auto; }
.admin-login__panel-mid h2 { font-size: 2rem; margin: 0 0 .5rem; }
.admin-login__panel-mid p { opacity: .92; margin: 0 0 1.6rem; max-width: 420px; }
.admin-login__feature { display: flex; align-items: center; gap: .9rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: .7rem; }
.admin-login__feature .icon-box { width: 38px; height: 38px; border-radius: 9px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; flex: none; }
.admin-login__feature strong { display: block; font-size: .92rem; }
.admin-login__feature span { display: block; font-size: .8rem; opacity: .85; margin-top: .15rem; }
.admin-login__panel-bottom { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; font-size: .82rem; opacity: .85; }

/* ---------- misc ---------- */
.two-pane { display: grid; grid-template-columns: 2fr 1fr; gap: 1.4rem; align-items: start; }
.two-pane--single { grid-template-columns: minmax(0, 640px); justify-content: center; }

/* Money fields (prices, fees): a number input's spin-button arrows invite nudging a price up
   or down by a whole unit without noticing, and they take up space better used for the value
   itself — hide them, on every browser engine that renders them. */
input.input-money::-webkit-outer-spin-button,
input.input-money::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.input-money { -moz-appearance: textfield; }

.upload-progress { margin-top: .6rem; }
.upload-progress__bar { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.upload-progress__fill { height: 100%; width: 0%; background: var(--gold); transition: width .15s linear; }
.upload-progress__pct { display: block; margin-top: .3rem; font-size: .82rem; color: var(--muted); }
.upload-error { color: #c0392b; font-size: .85rem; margin-top: .4rem; }
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table td { padding: .5rem 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.kv-table td:first-child { color: var(--muted); width: 38%; }
.hash-chip { font-family: var(--font-latin); font-size: .72rem; color: var(--muted); word-break: break-all; }

@media (max-width: 960px) {
  .admin-sidebar { position: fixed; inset-inline-start: 0; top: 0; height: 100vh; transform: translateX(-100%); transition: .2s; z-index: 50; }
  html.rtl .admin-sidebar, body.rtl .admin-sidebar { transform: translateX(100%); }
  .admin-sidebar.is-open { transform: none; }
  .two-pane { grid-template-columns: 1fr; }
}
