/* ==========================================================
   Reseller panel — black / ice blue
   ========================================================== */

:root {
  --void:       #05080c;
  --void-2:     #080d13;
  --panel:      #0b1119;
  --panel-2:    #111a24;
  --panel-hi:   #16222e;
  --edge:       #19242f;
  --edge-lit:   #27404f;

  --frost:      #7fdcff;
  --frost-dim:  #3aa5d6;
  --frost-deep: #17627f;
  --frost-pale: #e2f5ff;

  --text:       #c3d5e3;
  --muted:      #62809a;
  --dim:        #3f5568;

  --ok:   #4fd6a0;
  --warn: #f0c24b;
  --bad:  #ff6b7a;

  --r: 10px;
  --shell: 244px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* faint cold light from the top-left, keeps the black from going flat */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 8% -8%, rgba(127, 220, 255, .07), transparent 65%),
    radial-gradient(700px 400px at 100% 0%, rgba(58, 165, 214, .04), transparent 60%);
  z-index: 0;
}

a { color: var(--frost); text-decoration: none; }
a:hover { color: var(--frost-pale); }

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--frost-pale);
  margin: 0 0 .5rem;
}
h1 { font-size: 1.55rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }

.mono, code, .key {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

/* ---------- shell ---------------------------------------- */

.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.side {
  width: var(--shell);
  flex: 0 0 var(--shell);
  background: linear-gradient(180deg, var(--void-2), var(--void));
  border-right: 1px solid var(--edge);
  padding: 1.4rem 0 2rem;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 0 1.4rem 1.3rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.brand .mark {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 6px;
  background: linear-gradient(150deg, var(--frost), var(--frost-deep));
  box-shadow: 0 0 16px rgba(127, 220, 255, .35);
}
.brand b {
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--frost-pale);
}
.brand small {
  display: block;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.nav { padding: 0 .8rem; display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 1.1rem .6rem .4rem;
}
.nav a {
  display: block;
  padding: .5rem .6rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: .9rem;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.on {
  background: var(--panel-2);
  color: var(--frost-pale);
  border-left-color: var(--frost);
}

.side-foot { margin-top: auto; padding: 1rem 1.4rem 0; }

.balance {
  border: 1px solid var(--edge);
  border-radius: var(--r);
  background: var(--panel);
  padding: .7rem .8rem;
  margin-bottom: .8rem;
}
.balance span {
  display: block;
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.balance strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--frost);
}

.main { flex: 1; padding: 2rem 2.2rem 4rem; min-width: 0; }
.head { margin-bottom: 1.6rem; }
.head p { color: var(--muted); margin: .2rem 0 0; font-size: .92rem; }

/* ---------- panels --------------------------------------- */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  padding: 1.1rem 1.2rem;
  overflow: hidden;
}
.card::before {
  /* the frost edge — one bright hairline along the top */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 220, 255, .5) 30%, rgba(127, 220, 255, .12) 75%, transparent);
}
.card > h2, .card > h3 { margin-top: 0; }
.card .sub { color: var(--muted); font-size: .85rem; margin: -.25rem 0 .9rem; }

.grid { display: grid; gap: 1rem; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1rem; }

.stat span {
  display: block;
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: .3rem;
}
.stat strong {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--frost-pale);
  line-height: 1.1;
}
/* strong and em are inline by default, which put the headline number and the
   sub-line on the same row and read as "0 0 active" */
.stat em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: .8rem;
  margin-top: .3rem;
}

/* ---------- tables --------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  text-align: left;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--edge);
  white-space: nowrap;
}
td {
  padding: .6rem .7rem;
  border-bottom: 1px solid rgba(25, 36, 47, .7);
  vertical-align: middle;
}
tbody tr:hover td { background: rgba(17, 26, 36, .6); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: "JetBrains Mono", monospace; }

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.empty b { display: block; color: var(--text); margin-bottom: .25rem; }

/* ---------- pills / badges -------------------------------- */

.pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  letter-spacing: .04em;
  border: 1px solid var(--edge-lit);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ice   { border-color: rgba(127,220,255,.35); color: var(--frost); background: rgba(127,220,255,.06); }
.pill.ok    { border-color: rgba(79,214,160,.35);  color: var(--ok);    background: rgba(79,214,160,.06); }
.pill.warn  { border-color: rgba(240,194,75,.35);  color: var(--warn);  background: rgba(240,194,75,.06); }
.pill.bad   { border-color: rgba(255,107,122,.35); color: var(--bad);   background: rgba(255,107,122,.06); }

/* ---------- forms ---------------------------------------- */

label {
  display: block;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: .3rem;
}
input, select, textarea {
  width: 100%;
  background: var(--void-2);
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--text);
  padding: .55rem .7rem;
  font-family: inherit;
  font-size: .92rem;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 150px; resize: vertical; font-family: "JetBrains Mono", monospace; font-size: .84rem; line-height: 1.7; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--frost-dim);
  box-shadow: 0 0 0 3px rgba(127, 220, 255, .12);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
.field { margin-bottom: .85rem; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; text-transform: none; letter-spacing: 0; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-start; }
.row > * { flex: 1 1 140px; }
/* a field with a hint under it is taller; aligning tops keeps every label and
   input on the same line instead of shunting the shorter one upward */
.row > .tight { flex: 0 0 auto; align-self: flex-end; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--panel-2);
  border: 1px solid var(--edge-lit);
  color: var(--text);
  border-radius: 8px;
  padding: .55rem .95rem;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { background: var(--panel-hi); border-color: var(--frost-deep); color: var(--frost-pale); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }
.btn.primary {
  background: linear-gradient(180deg, rgba(127,220,255,.16), rgba(127,220,255,.06));
  border-color: var(--frost-dim);
  color: var(--frost-pale);
}
.btn.primary:hover { background: linear-gradient(180deg, rgba(127,220,255,.26), rgba(127,220,255,.1)); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: rgba(255,107,122,.3); }
.btn.danger:hover { background: rgba(255,107,122,.08); border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: .3rem .6rem; font-size: .78rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- flash ---------------------------------------- */

.flash {
  border-radius: var(--r);
  padding: .7rem .9rem;
  margin-bottom: .8rem;
  font-size: .9rem;
  border: 1px solid var(--edge-lit);
  background: var(--panel);
}
.flash.ok    { border-color: rgba(79,214,160,.4);  color: var(--ok); }
.flash.error { border-color: rgba(255,107,122,.4); color: var(--bad); }
.flash.warn  { border-color: rgba(240,194,75,.4);  color: var(--warn); }

/* ---------- key reveal ------------------------------------ */

.codebox {
  background: var(--void-2);
  border: 1px solid var(--frost-deep);
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.codebox .value {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.35rem;
  letter-spacing: .1em;
  color: var(--frost);
  word-break: break-all;
  margin: .3rem 0 .7rem;
}

.key {
  font-size: .85rem;
  color: var(--frost-pale);
  letter-spacing: .02em;
  word-break: break-all;
}

/* ---------- login ---------------------------------------- */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  position: relative;
  z-index: 1;
}
.gate-box { width: 100%; max-width: 430px; }
.gate-head { text-align: center; margin-bottom: 1.6rem; }
.gate-head .mark {
  width: 42px; height: 42px;
  border-radius: 11px;
  margin: 0 auto .9rem;
  background: linear-gradient(150deg, var(--frost), var(--frost-deep));
  box-shadow: 0 0 34px rgba(127, 220, 255, .3);
}
.gate-head h1 { font-size: 1.5rem; }
.gate-head p { color: var(--muted); font-size: .9rem; margin: .1rem 0 0; }

/* the one loud element: the access-code field */
.code-input {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.15rem;
  letter-spacing: .22em;
  text-align: center;
  text-transform: uppercase;
  padding: .95rem .6rem;
  background: var(--void-2);
  border: 1px solid var(--edge-lit);
}
.code-input:focus {
  border-color: var(--frost);
  box-shadow: 0 0 0 4px rgba(127, 220, 255, .1), 0 0 30px rgba(127, 220, 255, .12) inset;
}
.gate .btn { width: 100%; justify-content: center; margin-top: .6rem; padding: .7rem; }
.gate-foot { text-align: center; margin-top: 1.2rem; font-size: .8rem; color: var(--dim); }

/* ---------- misc ----------------------------------------- */

.split { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.dim   { color: var(--dim); }
.small { font-size: .82rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }
hr { border: none; border-top: 1px solid var(--edge); margin: 1.1rem 0; }
details summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
details summary:hover { color: var(--frost); }
details[open] summary { margin-bottom: .8rem; }

.copy-ok { color: var(--ok) !important; border-color: var(--ok) !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--edge-lit); }

/* ---------- responsive ----------------------------------- */

@media (max-width: 900px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; flex: none;
    border-right: none;
    border-bottom: 1px solid var(--edge);
    padding-bottom: 1rem;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none; }
  .nav a { border-left: none; border-bottom: 2px solid transparent; }
  .nav a.on { border-left: none; border-bottom-color: var(--frost); }
  .side-foot { margin-top: 1rem; display: flex; gap: .7rem; align-items: center; }
  .balance { margin-bottom: 0; flex: 1; }
  .main { padding: 1.25rem 1.1rem 3rem; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
