/* Rules the console never wrote.
 *
 * Its pages only ever render empty states — no key was ever listed, no key was
 * ever revealed — so there is nothing to copy for either. These are written in
 * the console's own idiom and use only its tokens, and they live apart from
 * app.css so that file stays a verbatim copy that can be regenerated.
 */

/* ── a populated key table ───────────────────────────────────────────────── */

.keys-row {
  min-width: 760px;
  min-height: 66px;
  padding: 0 23px;
  display: grid;
  grid-template-columns: 1.1fr .8fr 1.1fr .6fr 35px;
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  font-size: 11px;
}
.keys-row:last-child { border-bottom: 0; }
.keys-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--app-text);
}
.keys-row .keys-when { color: var(--app-muted); font-size: 10px; }
/* Digits in a column only line up if they are tabular. */
.keys-row .keys-when,
.keys-row code { font-variant-numeric: tabular-nums; }
.keys-row .keys-revoke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--app-border);
  color: var(--app-muted);
}
.keys-row .keys-revoke:hover { color: #e2807d; border-color: rgba(226, 128, 125, .35); }
.keys-table-scroll { overflow-x: auto; }

/* ── the key, shown once ─────────────────────────────────────────────────── */

.key-reveal {
  margin: 0 0 22px;
  padding: 22px 24px;
  border: 1px solid rgba(57, 198, 128, .28);
  border-radius: 18px;
  background: rgba(38, 166, 105, .06);
  display: grid;
  gap: 14px;
}
.key-reveal h2 { font-size: 15px; font-weight: 700; }
.key-reveal p { color: var(--app-muted); font-size: 11px; max-width: 62ch; }
.key-reveal-value {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-2);
}
.key-reveal-value code {
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .01em;
}
.key-reveal-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  font-size: 11px;
  white-space: nowrap;
}
.key-reveal-copy[data-copied="1"] { color: #3ed38b; border-color: rgba(57, 198, 128, .4); }

/* ── inline form controls that sit inside the console's own toolbars ─────── */

.inline-form { display: contents; }

/* ── populated catalog and register rows ─────────────────────────────────── */
/*
 * The console lists neither: its catalog and register only ever show the state
 * before a gateway is connected. Grid columns are copied from the matching
 * table heads it did write, so a row lines up with its header.
 */

.model-row,
.usage-row {
  min-width: 700px;
  min-height: 58px;
  padding: 0 23px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  font-size: 11px;
}
.model-row { grid-template-columns: 1.5fr .9fr .9fr .7fr .8fr 35px; }
.usage-row { grid-template-columns: 1fr 1.3fr .6fr .6fr .8fr .6fr; }
.model-row:last-child,
.usage-row:last-child { border-bottom: 0; }

.model-row code,
.usage-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}
.model-kind { color: var(--app-subtle); font-size: 10px; }

/* Figures only compare down a column if they are tabular and right-aligned. */
.model-price,
.usage-num,
.usage-when {
  font-variant-numeric: tabular-nums;
}
.model-price,
.usage-num { text-align: right; padding-right: 14px; }
.usage-when { color: var(--app-muted); font-size: 10px; }

/* An estimate has to look like one, or it reads as a measurement. */
.usage-num b {
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(231, 173, 70, .28);
  border-radius: 20px;
  color: #bca16e;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Filters and paging are links here rather than React state, so they need the
 * button styling the console gave to its <button> elements. */
.catalog-tabs a,
.segmented-control a,
.period-control a,
.table-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.catalog-controls form { display: contents; }

/* ── administrative rows ─────────────────────────────────────────────────── */
/*
 * The console's admin lists nothing either: every registry it drew is an empty
 * state waiting for a payment system. Columns match the .admin-table-head
 * variants it did write.
 */

.admin-row {
  min-width: 760px;
  min-height: 54px;
  margin: 0 -24px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1.2fr .8fr .9fr .7fr;
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  font-size: 11px;
}
.admin-row:last-of-type { border-bottom: 0; }
.admin-row small { display: block; color: var(--admin-subtle); font-size: 9px; margin-top: 3px; }

.admin-table-head.registry-customers,
.admin-row.registry-customers { grid-template-columns: 1.6fr .8fr .9fr .9fr .7fr .5fr; }

.admin-value { font-variant-numeric: tabular-nums; font-weight: 700; }
.admin-hint { color: var(--admin-subtle); font-size: 10px; }
.admin-num { font-variant-numeric: tabular-nums; text-align: right; padding-right: 16px; }

/* The tariff cards became forms; the console drew them as static fields. */
.tariff-editor form { display: contents; }
.tariff-fields input[readonly] { opacity: .65; cursor: default; }

/* ── the pricing screen ──────────────────────────────────────────────────── */
/*
 * Not in the console at all: its admin covers the payment circuit, and the
 * comparison against a vendor's own price is an operations screen. Built from
 * the console's own admin tokens.
 */

.admin-table-head.pricing,
.admin-row.pricing { grid-template-columns: 1.7fr .8fr .8fr .8fr .9fr .6fr 1fr; }
.admin-row.pricing code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }

/* A row that crosses the vendor's price has to be visible without reading. */
.admin-row.pricing.over { background: rgba(197, 60, 55, .07); }
.admin-row.pricing.over [data-our] { color: #e2807d; font-weight: 700; }

.stale-ref {
  margin-left: 8px; padding: 2px 7px;
  border: 1px solid rgba(231, 173, 70, .3); border-radius: 20px;
  color: #bca16e; font-size: 8px; font-weight: 700; text-transform: uppercase;
}

.pricing-markup {
  margin: 18px 0 4px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--admin-border); border-radius: 14px;
  background: var(--admin-surface-2, var(--panel-2));
}
.pricing-markup label { font-size: 11px; color: var(--admin-subtle); }
.pricing-markup input[type="range"] { flex: 1; min-width: 180px; accent-color: var(--blue); }
.pricing-markup output {
  min-width: 3.5rem; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700;
}
.pricing-hint { font-size: 10px; color: var(--admin-subtle); }

.pricing-tariff-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.pricing-tariff-switch a {
  padding: 8px 14px;
  border: 1px solid var(--admin-border); border-radius: 20px;
  font-size: 11px; color: var(--admin-muted);
}
.pricing-tariff-switch a.active { color: var(--text); border-color: var(--line-bright); }

/* ── the administrative register and the tariff model editor ─────────────── */

.admin-table-head.ledger,
.admin-row.ledger { grid-template-columns: .8fr 1.3fr 1.3fr .6fr .6fr .8fr .8fr .5fr .6fr; }
.admin-table-head.models,
.admin-row.models { grid-template-columns: 1.8fr .5fr .9fr .9fr 1.1fr .7fr; }

.admin-when { color: var(--admin-subtle); font-size: 10px; font-variant-numeric: tabular-nums; }
.admin-row.ledger code,
.admin-row.models code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
  padding-right: 10px;
}
/* A model already in the tariff should be findable in a long catalog at a
   glance, rather than by reading every badge. */
.admin-row.models.granted { background: rgba(57, 198, 128, .045); }

.model-actions { display: flex; gap: 6px; justify-content: flex-end; padding-right: 6px; }
.model-actions button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--admin-border); border-radius: 8px;
  color: var(--admin-muted);
}
.model-actions button:hover { color: var(--text); border-color: var(--line-bright); }

/* ── the credentials screen ──────────────────────────────────────────────── */

.secret-row {
  display: grid;
  grid-template-columns: 1.3fr .9fr 1.2fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--admin-border);
}
.secret-row:last-child { border-bottom: 0; }
.secret-label strong { display: block; font-size: 12px; }
.secret-label small { display: block; margin-top: 4px; color: var(--admin-subtle); font-size: 10px; }
.secret-state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.secret-state code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
@media (max-width: 900px) {
  .secret-row { grid-template-columns: 1fr; }
}

/* The restart control sits inside a warning, not on its own panel: it is a
   consequence of the message above it, and separating them would let somebody
   read one without the other. */
.admin-inline-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.admin-inline-form small {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  max-width: 34rem;
}
