/* NomadNet cabinet — academy palette: coral CTA #CC7357, cream light, navy dark */
:root {
  --coral: #CC7357;
  --coral-hover: #b96146;
  --cream: #F6F4EF;
  --navy: #0A0A12;
  --navy-2: #14121E;
  --bg: var(--cream);
  --surface: #FFFFFF;
  --text: #1c1a24;
  --muted: #6f6a7a;
  --border: #e4e0d6;
  --ok: #2e7d52;
  --warn: #a86a12;
  --danger: #b3402f;
  --radius: 14px;
  font-family: "Inter Tight", "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy);
    --surface: var(--navy-2);
    --text: #efedf5;
    --muted: #9a94ab;
    --border: #29263a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--coral); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .75rem; }
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.topbar { border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: .65rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-dot { color: var(--coral); }
.nav { display: flex; gap: 1rem; }
.nav a { color: var(--muted); font-weight: 500; padding: .25rem 0; }
.nav a.active, .nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { box-shadow: inset 0 -2px 0 var(--coral); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.user-email { color: var(--muted); font-size: .85rem; }
.lang-switch a { color: var(--muted); font-size: .8rem; font-weight: 600; }
.lang-switch a.active { color: var(--coral); }
.lang-sep { color: var(--border); margin: 0 .2rem; }

.main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 2rem 1.25rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.auth-card { max-width: 420px; margin: 3rem auto; }

label { display: block; font-weight: 500; font-size: .9rem; margin: .9rem 0 .3rem; }
input[type=email], input[type=password], input[type=number], input[type=text], select {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--coral); outline-offset: 1px; border-color: var(--coral); }
.hint { color: var(--muted); font-size: .8rem; margin: .3rem 0 0; }

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .6rem 1.1rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--coral-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; margin-top: 1.1rem; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.inline-form { display: inline; }
.cta-row { display: flex; gap: .75rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin: .2rem 0; }
.stat-sub { color: var(--muted); font-size: .8rem; }
.meter { height: 6px; border-radius: 3px; background: var(--border); margin-top: .6rem; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--coral); border-radius: 3px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
.cell-right { text-align: right; }
.row-revoked { opacity: .5; }

.tag {
  display: inline-block;
  padding: .1rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: .75rem;
  font-weight: 600;
  margin-right: .25rem;
}
.tag-topup, .tag-paid, .tag-grant { border-color: var(--ok); color: var(--ok); }
.tag-usage, .tag-pending { border-color: var(--warn); color: var(--warn); }
.tag-failed, .tag-refunded { border-color: var(--danger); color: var(--danger); }

.alert { border-radius: 10px; padding: .7rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: rgba(179, 64, 47, .12); color: var(--danger); border: 1px solid rgba(179, 64, 47, .35); }
.alert-warn { background: rgba(168, 106, 18, .12); color: var(--warn); border: 1px solid rgba(168, 106, 18, .35); }
.alert-ok { background: rgba(46, 125, 82, .12); color: var(--ok); border: 1px solid rgba(46, 125, 82, .35); }

.key-box {
  background: var(--bg);
  border: 1px dashed var(--coral);
  border-radius: 10px;
  padding: 1rem;
  font-size: .95rem;
  word-break: break-all;
  white-space: pre-wrap;
  user-select: all;
}
.scopes-set { border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem; margin: .5rem 0 1rem; }
.scopes-set legend { font-size: .85rem; font-weight: 600; padding: 0 .4rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: .4rem 0; }
.check input { width: auto; }
.muted { color: var(--muted); }
.key-created { max-width: 640px; margin: 2rem auto; }
