.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 12%, rgba(98, 214, 167, .14), transparent 28rem),
    linear-gradient(180deg, #07110d, #050b08);
}

.admin-header {
  position: relative;
  height: 88px;
  grid-template-columns: 1fr auto;
  background: rgba(7, 17, 13, .92);
}

.admin-back {
  color: var(--gold);
  font: 600 .58rem var(--title);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.admin-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5rem 0 8rem;
}

.login-vault {
  position: relative;
  display: grid;
  min-height: 680px;
  place-items: center;
  overflow: hidden;
}

.vault-rings,
.vault-rings i {
  position: absolute;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(216, 189, 120, .19);
  border-radius: 50%;
}

.vault-rings { animation: admin-spin 28s linear infinite; }
.vault-rings i:nth-child(1) { inset: 58px; width: auto; height: auto; border-style: dashed; }
.vault-rings i:nth-child(2) { inset: 130px; width: auto; height: auto; border-color: rgba(98, 214, 167, .28); }
.vault-rings i:nth-child(3) { left: 50%; top: -32px; width: 64px; height: 64px; border-radius: 0; transform: translateX(-50%) rotate(45deg); background: #07110d; }

@keyframes admin-spin { to { transform: rotate(360deg); } }

.vault-card {
  position: relative;
  z-index: 2;
  width: min(480px, calc(100% - 1rem));
  padding: 3rem;
  border: 1px solid var(--gold);
  background: linear-gradient(145deg, rgba(17, 42, 29, .96), rgba(5, 15, 9, .98));
  box-shadow: 0 35px 100px rgba(0, 0, 0, .55), 0 0 70px rgba(98, 214, 167, .13);
}

.vault-rune {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 2rem;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--emerald);
  font: 500 2rem var(--serif);
  box-shadow: 0 0 30px rgba(98, 214, 167, .18);
}

.vault-card h1,
.admin-titlebar h1 {
  margin: 0 0 1rem;
  font: 500 clamp(2.4rem, 5vw, 4.7rem)/.95 var(--title);
  letter-spacing: -.04em;
}

.vault-card h1 em { color: var(--emerald); font-family: var(--serif); }
.vault-card > p:not(.eyebrow) { color: var(--mist); font: 500 1rem/1.6 var(--serif); }
.vault-card form { margin-top: 2rem; }
.vault-card label span { color: var(--gold); }
.vault-card input { color: var(--parchment); border-bottom-color: rgba(216, 189, 120, .4); }

.admin-primary,
.admin-secondary,
.admin-action,
.admin-tab {
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, #d8bd78, #9f7d3d);
  color: var(--night);
  padding: .9rem 1.15rem;
  cursor: pointer;
  font: 650 .58rem var(--title);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.admin-primary { width: 100%; display: flex; justify-content: space-between; }
.admin-primary:disabled,
.admin-action:disabled { cursor: wait; opacity: .55; }
.admin-secondary { background: transparent; color: var(--gold); }
.admin-status { min-height: 1.3rem; color: var(--gold); font: 600 .73rem/1.5 var(--body); }

.admin-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 3rem;
}

.admin-titlebar p { color: var(--mist); }
.admin-tabs { display: flex; gap: .6rem; margin-bottom: 1rem; }
.admin-tab { background: #0b1912; color: var(--mist); }
.admin-tab.is-active { background: var(--gold); color: var(--night); }

.admin-panel {
  padding: clamp(1.3rem, 4vw, 3rem);
  border: 1px solid var(--line);
  background: rgba(11, 25, 18, .93);
}

.admin-panel > p { color: var(--mist); line-height: 1.65; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.panel-heading h2 { margin: 0; font: 500 clamp(1.7rem, 4vw, 3.2rem)/1 var(--title); }

.order-list { display: grid; gap: 1.15rem; margin-top: 2rem; }
.order-card {
  padding: clamp(1.1rem, 3vw, 1.7rem);
  border: 1px solid rgba(216, 189, 120, .28);
  background: linear-gradient(145deg, rgba(8, 24, 16, .98), rgba(5, 14, 10, .98));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 16px 35px rgba(0, 0, 0, .16);
}

.order-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.3rem; }
.order-reference { margin: 0 0 .45rem; color: var(--gold); font: 700 .58rem var(--title); letter-spacing: .13em; }
.order-card h3 { margin: 0 0 .5rem; color: var(--parchment); font: 600 clamp(1.15rem, 2.5vw, 1.6rem)/1.2 var(--title); }
.order-card small { color: #9aaca1; font-size: .8rem; }
.order-status {
  flex: 0 0 auto;
  padding: .48rem .72rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 750 .57rem var(--title);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-new { color: #77d6ff; background: rgba(50, 151, 194, .11); }
.status-processing { color: #f0cc72; background: rgba(216, 189, 120, .11); }
.status-rejected { color: #f1a0a0; background: rgba(184, 77, 77, .12); }
.status-completed { color: #77d9a9; background: rgba(63, 175, 116, .12); }

.order-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin: 1.35rem 0;
}

.order-details > div { min-width: 0; padding: .85rem 1rem; border: 1px solid rgba(98, 214, 167, .12); background: rgba(98, 214, 167, .035); }
.order-details dt { margin-bottom: .34rem; color: var(--gold); font: 700 .57rem var(--title); letter-spacing: .09em; text-transform: uppercase; }
.order-details dd { margin: 0; color: #f0ede0; font: 500 .92rem/1.45 var(--body); overflow-wrap: anywhere; }
.order-details a { color: #8ce8c1; text-decoration: underline; text-underline-offset: .18rem; }
.order-message { padding: 1rem 1.1rem; border-left: 3px solid var(--emerald); background: rgba(98, 214, 167, .055); }
.order-message strong { color: var(--gold); font: 700 .61rem var(--title); letter-spacing: .08em; text-transform: uppercase; }
.order-message p { margin: .55rem 0 0; color: #e1e6df; font: 500 1rem/1.65 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.order-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.2rem; }
.order-action { background: transparent; color: var(--gold); }
.order-action-new { border-color: #5bb6d8; color: #77d6ff; }
.order-action-processing { border-color: #b89647; color: #f0cc72; }
.order-action-rejected { border-color: #a75e5e; color: #f1a0a0; }
.order-action-completed { border-color: #4ba476; color: #77d9a9; }
.order-action:disabled { cursor: default; opacity: 1; color: var(--night); background: currentColor; filter: brightness(.95); }
.order-action-new:disabled { background: #77d6ff; }
.order-action-processing:disabled { background: #f0cc72; }
.order-action-rejected:disabled { background: #f1a0a0; }
.order-action-completed:disabled { background: #77d9a9; }
.admin-empty { padding: 2rem; border: 1px dashed var(--line); color: var(--mist); text-align: center; }
.orders-archive { margin-top: 1.4rem; border: 1px solid rgba(216, 189, 120, .25); background: rgba(3, 11, 7, .68); }
.archive-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  border: 0;
  background: linear-gradient(90deg, rgba(216, 189, 120, .09), transparent);
  color: var(--parchment);
  cursor: pointer;
  text-align: left;
}

.archive-toggle > span:first-child { display: grid; gap: .28rem; }
.archive-toggle small { color: var(--gold); font: 700 .54rem var(--title); letter-spacing: .12em; }
.archive-toggle strong { font: 600 1rem var(--title); }
.archive-toggle-mark { color: var(--gold); font: 400 1.8rem/1 var(--serif); transition: transform .24s ease; }
.archive-toggle[aria-expanded="true"] .archive-toggle-mark { transform: rotate(180deg); }
.archive-toggle:hover:not(:disabled),
.archive-toggle:focus-visible { background: linear-gradient(90deg, rgba(216, 189, 120, .16), rgba(98, 214, 167, .04)); }
.archive-toggle:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; }
.archive-toggle:disabled { cursor: default; opacity: .58; }
.archive-list { margin: 0; padding: 0 1rem 1rem; }
.archive-list .order-card { border-color: rgba(216, 189, 120, .16); background: linear-gradient(145deg, rgba(7, 19, 13, .96), rgba(4, 11, 8, .98)); }

.admin-entry-list { display: grid; gap: 1rem; margin-top: 2rem; }
.admin-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  padding: 1.3rem;
  border: 1px solid var(--line);
  background: #08130e;
}

.admin-entry h3 { margin: 0 0 .6rem; font: 600 1rem var(--title); }
.admin-entry blockquote { margin: 0; color: var(--mist); font: 500 1rem/1.55 var(--serif); }
.admin-entry small { display: block; margin-top: .8rem; color: #728479; }
.entry-state { display: inline-block; margin-left: .7rem; color: var(--gold); text-transform: uppercase; }
.admin-entry-actions { display: flex; flex-wrap: wrap; align-content: center; justify-content: flex-end; gap: .5rem; }
.admin-action { padding: .7rem .85rem; }
.admin-action.hide { background: transparent; color: var(--gold); }
.admin-action.delete { border-color: #9b5656; background: transparent; color: #e4a1a1; }

.showroom-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.showroom-edit-card { padding: 1.3rem; border: 1px solid var(--line); background: #08130e; }
.showroom-edit-card h3 { margin: 0 0 1rem; font: 600 1rem var(--title); color: var(--gold); }
.showroom-preview {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16/10;
  margin-bottom: 1.2rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(circle, #173b2a, #07110d 70%);
  color: #708379;
}

.showroom-preview img { width: 100%; height: 100%; object-fit: contain; background: #050d09; }
.showroom-edit-card label span { color: var(--gold); }
.showroom-edit-card input,
.showroom-edit-card textarea { color: var(--parchment); border-bottom-color: rgba(216, 189, 120, .32); }
.showroom-edit-card input[type="file"] { padding: .7rem; border: 1px dashed var(--line); }
.showroom-card-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .8rem; }

[hidden] { display: none !important; }

@media (max-width: 800px) {
  .admin-shell { padding-top: 3rem; }
  .vault-card { padding: 2rem 1.3rem; }
  .admin-titlebar,
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .showroom-editor { grid-template-columns: 1fr; }
  .admin-entry { grid-template-columns: 1fr; }
  .admin-entry-actions { justify-content: flex-start; }
  .admin-tabs { overflow-x: auto; }
  .order-details { grid-template-columns: 1fr 1fr; }
  .order-card-head { flex-direction: column; }
}

@media (max-width: 520px) {
  .order-details { grid-template-columns: 1fr; }
  .order-actions .admin-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { .vault-rings { animation: none; } }
