/* ============================================================
   WULFRIC COMMERCE — admin panel styles (on top of store.css)
   ============================================================ */

/* ---------------- login ---------------- */
.admin-login {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}

.login-card {
  position: relative;
  width: min(24rem, 100%);
  display: grid;
  gap: .8rem;
  padding: 2.75rem 2.5rem;
  background: linear-gradient(180deg, rgba(16,19,29,.8), rgba(11,13,20,.8));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.login-card::after { /* aurora edge */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(240,168,104,.4), transparent 35%, transparent 65%, rgba(139,124,246,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
}
.shop-brand-mark.big { width: 1.2rem; height: 1.2rem; margin-bottom: .5rem; }
.login-sigil { width: 1.9rem; height: 1.9rem; margin-bottom: .5rem; }
.login-sigil { width: 2rem; height: 2rem; margin-bottom: .5rem; }
.login-card h1 { font-size: 1.8rem; }
.login-sub { color: var(--text-dim); font-size: var(--fs-small); margin-bottom: 1rem; }
.login-card label { font-size: var(--fs-small); color: var(--text-dim); }
.login-card input[type="password"] {
  background: rgba(5,6,10,.6);
  border: 1px solid var(--hairline-strong);
  border-radius: .65rem;
  padding: .8rem 1rem;
  color: var(--text);
}
.login-card input:focus {
  outline: none;
  border-color: rgba(126,232,200,.6);
  box-shadow: 0 0 0 3px rgba(126,232,200,.08);
}
.login-card .btn-buy { margin-top: .75rem; }
.login-error { color: #f0a8a8; font-size: var(--fs-small); }
.login-demo { font-size: var(--fs-small); color: var(--text-faint); }
.login-demo code { color: var(--teal); font-family: inherit; }

/* ---------------- panel chrome ---------------- */
.admin-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--hairline);
  background: rgba(5,6,10,.8);
  position: sticky;
  top: 0;
  z-index: 40;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.admin-chip {
  font-family: var(--font-body);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .25rem .7rem;
  border: 1px solid rgba(126,232,200,.4);
  color: var(--teal);
  border-radius: 99px;
}

.admin-tabs { display: flex; gap: .4rem; }
.admin-tabs button {
  padding: .55rem 1.2rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 99px;
  color: var(--text-dim);
  font-size: var(--fs-small);
  cursor: pointer;
  transition: all .25s ease;
}
.admin-tabs button:hover { color: var(--text); }
.admin-tabs button.is-active {
  background: rgba(233,230,221,.07);
  border-color: var(--hairline-strong);
  color: var(--text);
}

.admin-top-actions { display: flex; align-items: center; gap: 1.25rem; font-size: var(--fs-small); }
.admin-top-actions a { color: var(--text-dim); }
.admin-top-actions a:hover { color: var(--teal); }
.admin-top-actions button {
  background: none;
  border: 0;
  color: var(--text-faint);
  font-size: var(--fs-small);
  cursor: pointer;
}
.admin-top-actions button:hover { color: var(--text); }

.admin { position: relative; z-index: 2; }

.admin-main {
  max-width: 62rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 5rem;
}

/* ---------------- stat cards ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .9rem;
  margin-bottom: 2rem;
}
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  padding: 1.1rem 1.3rem;
  background: linear-gradient(180deg, rgba(16,19,29,.7), rgba(11,13,20,.7));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  display: grid;
  gap: .15rem;
  transition: border-color .3s ease;
}
.stat-card:hover { border-color: rgba(233,230,221,.2); }
.stat-card strong {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 400;
  line-height: 1.1;
}
.stat-card span {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stat-card.stat-accent strong {
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.pane-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.pane-head h2 { font-size: 1.7rem; }
.pane-sub { color: var(--text-faint); font-size: var(--fs-small); }

/* ---------------- product table ---------------- */
.product-table { display: grid; gap: .6rem; }

.prow {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto auto auto;
  align-items: center;
  gap: 1.1rem;
  padding: .75rem 1rem;
  background: linear-gradient(180deg, rgba(16,19,29,.6), rgba(11,13,20,.6));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: border-color .25s ease, transform .35s var(--ease-out), box-shadow .35s ease;
}
.prow:hover {
  border-color: rgba(233,230,221,.22);
  transform: translateX(3px);
  box-shadow: -3px 0 0 rgba(126, 232, 200, .35);
}
.prow-img { transition: transform .4s var(--ease-out); }
.prow:hover .prow-img { transform: scale(1.06); }
.prow.is-off { opacity: .55; }

.prow-img {
  width: 3.2rem; height: 3.2rem;
  border-radius: .6rem;
  object-fit: cover;
  border: 1px solid var(--hairline);
  background: var(--ink-2);
}
.prow-ph { display: block; }

.prow-name { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.prow-name strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-hidden-tag {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--hairline-strong);
  padding: .15rem .55rem;
  border-radius: 99px;
  flex-shrink: 0;
}

.prow-price { color: var(--text-dim); font-size: var(--fs-small); white-space: nowrap; }
.prow-qty { font-size: var(--fs-small); color: var(--text-faint); white-space: nowrap; }
.prow-qty.is-low { color: var(--teal); }
.prow-qty.is-zero { color: #f0a8a8; }

.prow-edit { padding: .45rem 1.1rem; }

@media (max-width: 640px) {
  .prow { grid-template-columns: 3.2rem 1fr auto; }
  .prow-price, .prow-qty { display: none; }
}

/* ---------------- orders ---------------- */
.orders-list { display: grid; gap: .8rem; }

.order-card {
  padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, rgba(16,19,29,.6), rgba(11,13,20,.6));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  display: grid;
  gap: .4rem;
}
.order-head-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.order-head-row strong { font-size: 1.1rem; }
.order-head-row span { color: var(--text-faint); font-size: .8rem; }
.order-buyer { color: var(--text-dim); font-size: var(--fs-small); }
.order-items {
  list-style: none;
  padding: .5rem 0 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: .2rem;
}
.order-items li { font-size: var(--fs-small); color: var(--text-dim); }

/* ---------------- edit modal ---------------- */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5,6,10,.65);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .28s ease;
}
.modal-scrim.is-open { opacity: 1; }

.edit-modal {
  position: fixed;
  z-index: 91;
  inset: 0;
  margin: auto;
  width: min(44rem, calc(100vw - 2rem));
  height: fit-content;
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  background: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .7), 0 0 60px -30px rgba(126, 232, 200, .25);
  opacity: 0;
  transform: translateY(16px) scale(.98);
  transition: opacity .28s ease, transform .32s var(--ease-out);
}
.edit-modal.is-open { opacity: 1; transform: none; }

.edit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--hairline);
}
.edit-head h3 { font-size: 1.3rem; }

.edit-form { padding: 1.5rem; }

.edit-grid {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.75rem;
}
@media (max-width: 640px) { .edit-grid { grid-template-columns: 1fr; } }

.edit-image { display: grid; gap: .75rem; align-content: start; }
.edit-image-frame {
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px dashed var(--hairline-strong);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(5,6,10,.5);
}
.edit-image-frame img { width: 100%; height: 100%; object-fit: cover; }
.edit-image-empty { color: var(--text-faint); font-size: var(--fs-small); }
.edit-upload-btn { cursor: pointer; text-align: center; }
.edit-hint { font-size: .75rem; color: var(--text-faint); }

.edit-fields { display: grid; gap: .55rem; align-content: start; }
.edit-fields label { font-size: var(--fs-small); color: var(--text-dim); margin-top: .5rem; }
.edit-fields input[type="text"],
.edit-fields input[type="number"],
.edit-fields textarea {
  background: rgba(5,6,10,.6);
  border: 1px solid var(--hairline-strong);
  border-radius: .65rem;
  padding: .7rem .9rem;
  color: var(--text);
  width: 100%;
}
.edit-fields input:focus, .edit-fields textarea:focus {
  outline: none;
  border-color: rgba(126,232,200,.6);
  box-shadow: 0 0 0 3px rgba(126,232,200,.08);
}
.edit-fields textarea { resize: vertical; }

.edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.edit-row label { margin-top: .5rem; display: block; }

.edit-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1rem;
  cursor: pointer;
  font-size: var(--fs-small);
  color: var(--text-dim);
}
.edit-toggle input { accent-color: #7ee8c8; width: 1.05rem; height: 1.05rem; }

.edit-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}
.edit-error { color: #f0a8a8; font-size: var(--fs-small); margin-right: auto; }
