/* Operations panel.
   Deliberately plainer than the storefront: this is a working surface, so
   density and legibility beat decoration. It borrows the site's palette so the
   two do not feel like different products. */

.adm-body {
  background: #f4f6fa;
  color: var(--body-text, #1d2939);
  font-family: Lato, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ------------------------------------------------------------------ chrome */
.adm-top {
  position: sticky; top: 0; z-index: 20;
  background: #0d1626;
  border-bottom: 1px solid #1c2b45;
}
.adm-top__in {
  display: flex; align-items: center; gap: 24px;
  max-width: 1440px; margin: 0 auto; padding: 0 20px; height: 58px;
}
.adm-brand { color: #fff; font-weight: 800; text-decoration: none; font-size: 16px; }
.adm-brand span { color: #7d8ba5; font-weight: 600; margin-left: 6px; }

.adm-tabs { display: flex; gap: 4px; margin-right: auto; }
.adm-tab {
  background: none; border: 0; cursor: pointer;
  color: #a4b1c7; font: inherit; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 8px;
}
.adm-tab:hover { color: #fff; background: #17243a; }
.adm-tab.is-on { color: #fff; background: var(--accent, #2f6fed); }

.adm-pill {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 6px;
  background: #e0413c; color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-align: center;
}

.adm-top__right { display: flex; align-items: center; gap: 12px; }
.adm-who { color: #7d8ba5; font-size: 13px; }
.adm-refresh {
  background: #17243a; border: 1px solid #24354f; color: #cdd7e6;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
}
.adm-refresh:hover { background: #1e2f49; color: #fff; }
.adm-refresh.is-busy { opacity: .55; pointer-events: none; }

.adm-main { max-width: 1440px; margin: 0 auto; padding: 22px 20px 60px; }

.adm-alert {
  margin: 0 0 16px; padding: 11px 14px; border-radius: 10px;
  background: #fdecec; border: 1px solid #f3c2c0; color: #8c2320;
  font-size: 14px; font-weight: 600;
}
.adm-alert.is-ok { background: #e8f6ec; border-color: #b6e0c1; color: #1c6b33; }

/* ------------------------------------------------------------------- cards */
.adm-cards {
  display: grid; gap: 14px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.adm-card {
  background: #fff; border: 1px solid #e3e8f0; border-radius: 12px; padding: 16px 18px;
}
.adm-card__label {
  display: block; color: #6b7a94; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.adm-card__value { display: block; margin-top: 6px; font-size: 28px; font-weight: 800; }
.adm-card__note { display: block; margin-top: 4px; color: #6b7a94; font-size: 13px; }
.adm-card__note b { color: #1c6b33; }
.adm-card__note b.is-bad { color: #b3312c; }

/* ------------------------------------------------------------------ panels */
.adm-split {
  display: grid; gap: 14px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.adm-panel {
  background: #fff; border: 1px solid #e3e8f0; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px;
}
.adm-panel h2 { margin: 0 0 14px; font-size: 15px; font-weight: 800; }

.adm-bars { display: grid; gap: 9px; }
.adm-bar { display: grid; grid-template-columns: 120px 1fr 64px; align-items: center; gap: 10px; }
.adm-bar__name { font-size: 13px; font-weight: 600; color: #445067; }
.adm-bar__track { height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.adm-bar__fill { height: 100%; background: var(--accent, #2f6fed); border-radius: 999px; }
.adm-bar__fill.is-bad { background: #e0413c; }
.adm-bar__fill.is-warn { background: #e8912a; }
.adm-bar__fill.is-good { background: #2aa04f; }
.adm-bar__n { font-size: 13px; font-weight: 700; text-align: right; }

.adm-kv { display: grid; gap: 8px; }
.adm-kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.adm-kv span { color: #6b7a94; }
.adm-kv b { font-weight: 800; }

/* ------------------------------------------------------------------ tables */
.adm-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.adm-toolbar select, .adm-toolbar input {
  font: inherit; font-size: 14px; padding: 9px 12px;
  border: 1px solid #d6dde8; border-radius: 9px; background: #fff;
}
.adm-toolbar input { flex: 1; min-width: 220px; }

.adm-tablewrap { overflow-x: auto; background: #fff; border: 1px solid #e3e8f0; border-radius: 12px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-table th {
  text-align: left; padding: 11px 14px; background: #f7f9fc;
  color: #55637c; font-weight: 700; font-size: 12px;
  letter-spacing: .03em; text-transform: uppercase;
  border-bottom: 1px solid #e3e8f0; white-space: nowrap;
}
.adm-table td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; vertical-align: top; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table tr.is-click { cursor: pointer; }
.adm-table tr.is-click:hover td { background: #f7f9fc; }
.adm-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adm-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.adm-empty { padding: 26px 14px; text-align: center; color: #6b7a94; }

.adm-st {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.adm-st--fulfilled { background: #e8f6ec; color: #1c6b33; }
.adm-st--fulfilling { background: #e7effd; color: #1c4a9e; }
.adm-st--paid { background: #e7effd; color: #1c4a9e; }
.adm-st--pending { background: #fdf3e3; color: #8a5a11; }
.adm-st--held { background: #fdecd8; color: #8a4a11; }
.adm-st--failed { background: #fdecec; color: #8c2320; }
.adm-st--expired { background: #eef1f6; color: #55637c; }

.adm-err { display: block; margin-top: 4px; color: #b3312c; font-size: 12.5px; max-width: 420px; }

.adm-act {
  background: var(--accent, #2f6fed); border: 0; color: #fff;
  font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.adm-act:hover { filter: brightness(1.07); }
.adm-act[disabled] { opacity: .5; pointer-events: none; }
.adm-act--ghost { background: #eef1f6; color: #44506; color: #445067; }
.adm-act--danger { background: #fdecec; color: #8c2320; }

/* ------------------------------------------------------------------ drawer */
.adm-drawer { position: fixed; inset: 0; z-index: 40; }
.adm-drawer__bg { position: absolute; inset: 0; background: rgba(13, 22, 38, .45); }
.adm-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(680px, 100%);
  background: #f4f6fa; overflow-y: auto; padding: 22px 24px 60px;
  box-shadow: -8px 0 30px rgba(13, 22, 38, .18);
}
.adm-drawer__x {
  position: absolute; top: 12px; right: 16px;
  background: none; border: 0; font-size: 28px; line-height: 1;
  color: #6b7a94; cursor: pointer;
}
.adm-drawer h2 { margin: 0 0 4px; font-size: 20px; }
.adm-drawer h3 { margin: 22px 0 10px; font-size: 14px; font-weight: 800; }
.adm-drawer__sub { margin: 0 0 16px; color: #6b7a94; font-size: 13.5px; }

.adm-grant { background: #fff; border: 1px solid #e3e8f0; border-radius: 12px; padding: 14px 16px; }
.adm-grant__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-grant input[type=number] { width: 88px; }
.adm-grant input[type=text] { flex: 1; min-width: 180px; }
.adm-grant input {
  font: inherit; font-size: 14px; padding: 8px 11px;
  border: 1px solid #d6dde8; border-radius: 8px;
}
.adm-grant__opt { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 13px; color: #55637c; }

@media (max-width: 760px) {
  .adm-top__in { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .adm-tabs { order: 3; width: 100%; overflow-x: auto; }
  .adm-bar { grid-template-columns: 96px 1fr 50px; }
}


/* ---------------------------------------------------------------- keys
   Issuing a batch is four numbers and a name, so it stays one row wide on a
   desktop rather than becoming a page of its own. */
.adm-note { margin: -4px 0 16px; font-size: 13.5px; color: #55637c; max-width: 70ch; }

.adm-form {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.adm-form label {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; color: #55637c;
}
.adm-form__wide { grid-column: span 2; }
.adm-form input {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0;
  color: #1e2539; padding: 9px 12px;
  border: 1px solid #d6dde8; border-radius: 9px; background: #fff;
}
.adm-form input:focus { border-color: #2f6fed; outline: none; }
.adm-form button { height: 38px; }

.adm-mint { margin-top: 18px; }
.adm-mint__head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px;
}
.adm-mint__head span { display: flex; gap: 8px; }
.adm-mint textarea {
  width: 100%; padding: 12px 14px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.7; letter-spacing: .04em; color: #1e2539;
  background: #f7f9fc; border: 1px solid #e3e8f0; border-radius: 10px;
}

/* A code is read off a screen and typed somewhere else, so the groups have to
   stay visually separate at a glance. */
.adm-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; letter-spacing: .05em; white-space: nowrap;
}
.adm-row-actions { display: flex; gap: 6px; white-space: nowrap; }

@media (max-width: 700px) {
  .adm-form__wide { grid-column: span 1; }
}


/* Result of a grant, and the one checkbox on the form. */
.adm-msg {
  margin: 14px 0 0; padding: 10px 13px; border-radius: 8px;
  font-size: 14px; line-height: 1.5;
  background: #f2f5fa; border: 1px solid #dde4f0; color: #3c4761;
}
.adm-msg.is-ok { background: #edfaf1; border-color: #bfe6cd; color: #14663a; }
.adm-msg.is-bad { background: #fdf0f1; border-color: #f2c4c8; color: #9c2830; }

.adm-form label.adm-check {
  display: flex; align-items: center; gap: 9px; align-self: end;
  font-size: 14px; font-weight: 500; color: #3c4761;
  text-transform: none; letter-spacing: 0;
}
.adm-form label.adm-check input { width: auto; height: auto; margin: 0; }

/* ------------------------------------------------------------ money screen */

/* The one figure worth looking at first: what the shop earned on traffic it
   has actually delivered. */
.adm-card--key { border-color: #b9cdf5; background: #f5f9ff; }
.adm-card--key .adm-card__v { color: #123a78; }

.adm-out { color: #a32126; font-weight: 700; white-space: nowrap; }
.adm-dim { color: #8a97ad; }
.adm-lead { margin: -4px 0 16px; max-width: 70ch; font-size: 14px;
            line-height: 1.6; color: #5a6a85; }
.adm-form__wide { grid-column: 1 / -1; }
.adm-form__wide input { width: 100%; }
.adm-empty { padding: 20px; color: #8a97ad; }

/* The dropdown was the only control on the form still drawn by the browser. */
.adm-form select {
  display: block; width: 100%; margin-top: 6px; height: 38px;
  font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0;
  color: #1e2539; padding: 0 10px;
  border: 1px solid #d6dde8; border-radius: 9px; background: #fff;
}
.adm-form select:focus { border-color: #2f6fed; outline: none; }
/* A note about incomplete history can run long, and a card that clips it is
   worse than one that grows. */
.adm-card__note { line-height: 1.45; }


/* Orders: a paying row should be findable at a glance among the free ones. */
.adm-sum {
  margin: 0 0 10px;
  font: 600 14px/1.4 inherit;
  color: #0f172a;
}
.adm-table tr.adm-paid td { background: #f0fdf4; }
.adm-table tr.adm-paid td.num b { color: #15803d; font-weight: 700; }
.adm-free { color: #94a3b8; font-size: 12px; }
