/* /css/views/admin.css
   Internal operations console.

   This is a tool, not a storefront. The customer surfaces lean on gradient
   display type and glow; an admin panel should read as instrument panel:
   dense, quiet, high-contrast, with the data doing the work. The site's global
   heading rule paints h1/h2 with a clipped gradient and
   -webkit-text-fill-color: transparent, which is why headings in here have to
   reset that explicitly - setting `color` alone is overridden by the fill. */

.admin { padding: 0; }

/* Reset the inherited display-type treatment. Solid ink, tighter, smaller. */
.admin .shop-title,
.admin .adm-sec-title,
.admin .adm-h2 {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
}

/* hero.css sets `.panel h2 { color: transparent }` for the gradient display
   treatment. That selector outranks a bare `.adm-h2`, and currentColor then
   resolves to transparent, so these have to be scoped under .admin to win. */
.admin .shop-title {
  color: var(--ink);
  font-size: 1.5rem;
  letter-spacing: -.015em;
}
.admin .shop-kicker { color: var(--muted); }
.admin .shop-sub { max-width: 60ch; }

.adm-grid {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 20px;
}
@media (max-width: 62rem) {
  .adm-grid { grid-template-columns: minmax(0, 1fr); }
}

.adm-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .015);
  padding: 16px 18px 18px;
}

.admin .adm-h2 {
  margin: 0 0 4px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.adm-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.55;
}
.adm-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255, 255, 255, .06);
  border-radius: 3px;
  padding: .05rem .28rem;
  font-size: .92em;
}

.adm-empty {
  margin: 0;
  padding: 26px 0;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
}

/* ---------- mint form ---------- */
.adm-fields { display: flex; flex-direction: column; gap: 3px; }

.adm-label {
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-top: 12px;
}

.adm-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .28);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  transition: border-color 140ms ease;
}
.adm-input:hover { border-color: rgba(255, 255, 255, .18); }
.adm-input:focus-visible {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(33, 188, 165, .15);
}
#admCount { font-variant-numeric: tabular-nums; }

.adm-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.adm-error {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid rgba(239, 95, 107, .35);
  background: rgba(239, 95, 107, .1);
  color: #ff9aa2;
  font-size: .84rem;
}

/* ---------- mint result ---------- */
.adm-result {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.adm-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.adm-result-head strong {
  color: var(--ink);
  font-size: .84rem;
  font-weight: 600;
}
/* Copy-all sits inside the compact result head; the default .btn padding
   dwarfs it, so scale to the .btn-sm / console copy-button size. */
.adm-copy { padding: 6px 12px; font-size: .8rem; }

.adm-codes {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 5px;
}
.adm-codes li {
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 8px;
  text-align: center;
}
.adm-codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92rem;
  letter-spacing: .05em;
  color: var(--ink);
}

/* ---------- inventory ---------- */
.adm-inv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.adm-tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, .25);
}

.adm-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 12px;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 120ms ease;
}
.adm-tab:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.adm-tab:active { transform: translateY(1px); }
.adm-tab.is-active {
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
}
.adm-tab:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }

/* summary strip: state before the table */
.adm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 14px;
}
.adm-stat {
  background: rgba(0, 0, 0, .28);
  padding: 10px 12px;
}
.adm-stat-n {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.adm-stat-l {
  display: block;
  margin-top: 4px;
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* Wide tables scroll in their own container; the page never moves sideways. */
.adm-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  min-width: 34rem;
}
.adm-table thead th {
  text-align: left;
  font: 700 .6rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-600, #21bca5);
  opacity: .85;
  padding: 9px 12px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.adm-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: var(--ink);
  vertical-align: middle;
  white-space: nowrap;
}
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody td { transition: background 120ms ease; }
.adm-table tbody tr:hover td { background: rgba(162, 0, 255, .06); }
/* money and counts: monospace, right-aligned, digits in columns */
.adm-num {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
th.adm-num { text-align: right; }
/* Money moves in standard colors: green in, red out. Never decorative.
   (Element-qualified: the table's own td color rule outranks a lone class.) */
.adm-money-pos, .adm-table td.adm-money-pos, .adm-table td .adm-money-pos { color: #38ffb3; }
.adm-money-neg, .adm-table td.adm-money-neg, .adm-table td .adm-money-neg { color: #ff5d6c; }
/* Column content policy for tables that must fit their container at desktop
   width. Prose cells wrap at WORD BOUNDARIES only (never mid-token); short
   data (dates, money, pills) never wraps; long single tokens (emails,
   tracking and invoice numbers) ellipsize with the full value on the title.
   The scroll wrapper stays as the small-screen fallback only. */
.adm-table--wrap tbody td { white-space: normal; overflow-wrap: normal; word-break: normal; }
.adm-table td.cell-tight, .adm-table--wrap tbody td.cell-tight { white-space: nowrap; }
.adm-table td.cell-ellip, .adm-table--wrap tbody td.cell-ellip {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-table td.cell-ellip code { white-space: nowrap; }
.adm-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9rem;
  letter-spacing: .05em;
}
.adm-table td:nth-child(4),
.adm-table td:nth-child(5) { color: var(--muted); }

.adm-pill.is-bad {
  color: #ff5d6c;
  border-color: rgba(255, 93, 108, .45);
  background: rgba(255, 93, 108, .08);
}
.adm-pill {
  display: inline-block;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .07em;
  padding: .15rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
}
.adm-pill.is-available {
  color: #2fbf87;
  background: rgba(47, 191, 135, .12);
  border: 1px solid rgba(47, 191, 135, .25);
}
.adm-pill.is-claimed {
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
}

/* ============================================================
   Operator console shell: sidebar + section main
   ============================================================ */
.adm-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: min(78vh, 760px);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .012);
}

/* ---------- sidebar ---------- */
.adm-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, .22);
  padding: 16px 12px;
}
.adm-side-brand { padding: 6px 10px 14px; }
.adm-side-kicker {
  display: block;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-600, #21bca5);
  font-weight: 700;
}
.adm-side-title {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
  /* One line, ellipsized when it truly cannot fit. Breaking the address
     mid-token orphaned single characters onto their own row. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.adm-nav-item:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.adm-nav-item.is-active { background: rgba(33, 188, 165, .12); color: var(--ink); }
.adm-nav-item.is-active .adm-nav-ico { color: var(--brand-600, #21bca5); }
.adm-nav-ico { display: inline-grid; place-items: center; color: var(--muted); }
.adm-nav-item:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }

/* Divider label between the account group and the Internal group in the one
   shared sidebar. Same small-caps voice as the brand kicker, gold so the
   operator territory reads as marked. */
.adm-nav-div {
  margin: 14px 10px 4px;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-gold, #e6c688);
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  list-style: none;
}

.adm-side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-side-who { color: var(--ink); font-size: .8rem; font-weight: 600; word-break: break-all; }
.adm-side-role { color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- main ---------- */
.adm-main { padding: 22px 24px 26px; min-width: 0; }
/* The global `header { position: fixed }` rule is for the SITE nav. These are
   in-flow section headers; without this reset they rip out of the page and
   stamp themselves over the animated header. */
.adm-sec-head {
  position: static; background: none; border: 0; z-index: auto;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.admin .adm-sec-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
}

/* ---------- toolbar (users filters) ----------
   Same control language as the API Console: dark glass fields, purple glow on
   hover, hard ring on focus, a 1px press, themed option lists. Retro
   instrument panel, modern feedback. */
.adm-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-search, .adm-select, .adm-input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, .28);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  color-scheme: dark;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}
.adm-search { min-width: 200px; }
.adm-search::placeholder, .adm-input::placeholder { color: var(--muted); opacity: .75; }
.adm-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.adm-search:hover, .adm-select:hover, .adm-input:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  box-shadow:
    0 0 0 1px rgba(162, 0, 255, .22),
    0 0 16px rgba(162, 0, 255, .14);
}
.adm-search:focus-visible, .adm-select:focus-visible, .adm-input:focus-visible {
  outline: none;
  border-color: var(--brand-600);
  box-shadow:
    0 0 0 1px rgba(162, 0, 255, .45),
    0 0 14px rgba(162, 0, 255, .3);
}
.adm-select:active, select.adm-input:active { transform: translateY(1px); }

/* Native selects: kill the UA chrome, draw the console's twin-gradient
   chevron, theme the option list (Chromium honors it; elsewhere harmless). */
select.adm-select, select.adm-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, color-mix(in srgb, var(--brand-purp) 65%, var(--ink)) 50%),
    linear-gradient(-45deg, transparent 50%, color-mix(in srgb, var(--brand-purp) 65%, var(--ink)) 50%);
  background-repeat: no-repeat;
  background-position: calc(100% - 16px) 55%, calc(100% - 10px) 55%;
  background-size: 6px 6px;
}
select.adm-select option, select.adm-input option {
  background-color: var(--bg-deep);
  color: var(--muted);
  font-weight: 650;
}
select.adm-select option:checked, select.adm-input option:checked {
  background-color: color-mix(in srgb, var(--brand-purp) 22%, var(--bg-deep));
  color: var(--brand-600);
}

/* ---------- overview stat cards ---------- */
.adm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.adm-stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(12, 16, 26, .66), rgba(10, 6, 18, .5));
  padding: 18px 18px 15px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
/* thin spectrum accent along the top edge, console-instrument style */
.adm-stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand-600, #21bca5), rgba(162, 0, 255, .7) 55%, transparent 92%);
  opacity: .75;
}
.adm-stat-card:hover {
  border-color: rgba(162, 0, 255, .4);
  box-shadow: 0 0 0 1px rgba(162, 0, 255, .18), 0 0 18px rgba(162, 0, 255, .12);
  transform: translateY(-1px);
}
/* Numbers stay solid ink: money and counts are read, not decorated. The
   card's accent line carries the console look instead. */
.adm-stat-card .adm-stat-n {
  font-size: 1.9rem; font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  color: var(--ink);
}
.adm-stat-card .adm-stat-l {
  font: 700 .62rem/1.3 ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-top: 7px;
}
.adm-stat-h { font-size: .72rem; color: var(--muted); margin-top: 2px; }
/* solid accent variants (mode flags and the like) override the gradient */
.adm-stat-card.adm-stat-amber .adm-stat-n {
  background: none; -webkit-text-fill-color: #ffd489; color: #ffd489;
}
.adm-stat-card.adm-stat-teal .adm-stat-n {
  background: none; -webkit-text-fill-color: var(--brand-600, #21bca5); color: var(--brand-600, #21bca5);
}

/* ---------- users table extras ---------- */
.adm-muted { color: var(--muted); }
.adm-cell-email { color: var(--ink); font-weight: 500; }
.adm-users-table th, .adm-users-table td { white-space: nowrap; }

.adm-tier {
  text-transform: capitalize;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
}
.adm-tier-partner { color: #c9a3ff; background: rgba(162, 0, 255, .12); border-color: rgba(162, 0, 255, .28); }
.adm-tier-super   { color: #ffcf6a; background: rgba(255, 180, 40, .12); border-color: rgba(255, 180, 40, .3); }
.adm-tier-user    { color: #7fd8ff; background: rgba(31, 224, 255, .1); border-color: rgba(31, 224, 255, .28); }

.adm-flag-admin { color: #2fbf87; background: rgba(47, 191, 135, .12); border: 1px solid rgba(47, 191, 135, .28); margin-right: 4px; }
.adm-flag-dev   { color: #ff9aa2; background: rgba(239, 95, 107, .12); border: 1px solid rgba(239, 95, 107, .3); }

/* ---------- coming-soon sections ---------- */
.adm-soon {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}
.adm-soon-badge {
  display: inline-block;
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-600, #21bca5);
  border: 1px solid rgba(33, 188, 165, .3);
  border-radius: var(--radius-pill);
  padding: .2rem .7rem;
  margin-bottom: 12px;
}
.adm-soon p { margin: 0; font-size: .9rem; max-width: 42ch; margin-inline: auto; line-height: 1.5; }

/* ---------- responsive: sidebar becomes a top rail ---------- */
@media (max-width: 46rem) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-side { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; gap: 4px; overflow-x: auto; }
  .adm-side-brand, .adm-side-foot { display: none; }
  .adm-nav { flex-direction: row; }
  .adm-nav-item span:not(.adm-nav-ico) { display: none; }
  .adm-nav-item { padding: 9px 12px; }
}

/* ---- Catalog section ---- */
.adm-actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.adm-card-h {
  margin: 0 0 10px;
  font: 700 .7rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--brand-600, #21bca5);
}
