/* Cinder Platform — developer console. Shares the Cinder design tokens. */
:root {
  --bg: #0a0b0f;
  --panel: #14161d;
  --inset: #1a1d26;
  --border: #262a35;
  --text: #eceef4;
  --muted: #8b91a0;
  --accent: #7c6cff;
  --accent2: #5b8cff;
  --green: #9be6a0;
  --radius: 16px;
  --nav-h: 60px;
  --sidebar-w: 230px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 15, 0.72);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; }
.brand .spark {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; font-size: 13px; color: #fff;
}
.brand .tag { color: var(--muted); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.nav-right a:hover { color: var(--text); }
.btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 10px; padding: 8px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { border: none; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-ghost { background: transparent; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - var(--nav-h)); }
.side {
  border-right: 1px solid var(--border);
  padding: 22px 14px;
  position: sticky; top: var(--nav-h); align-self: start; height: calc(100vh - var(--nav-h));
}
.side .navitem {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted);
  padding: 9px 12px; border-radius: 9px; margin-bottom: 3px; cursor: pointer;
  width: 100%; border: none; background: transparent; text-align: left; font-family: inherit;
}
.side .navitem:hover { color: var(--text); background: var(--panel); }
.side .navitem.active { color: var(--text); background: var(--inset); box-shadow: inset 2px 0 0 var(--accent); }
.side .navitem .ico { width: 18px; text-align: center; }
.side .sep { height: 1px; background: var(--border); margin: 16px 6px; }

.main { padding: 32px 40px 80px; max-width: 940px; }
.page { display: none; }
.page.active { display: block; }
.page > h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.page > .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 26px; }
h2.section { font-size: 15px; font-weight: 600; margin: 30px 0 12px; color: var(--text); }

/* ---------- Cards / stats ---------- */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .d { font-size: 12px; color: var(--green); margin-top: 4px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 14px 0; }
.panel.flush { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.fs13 { font-size: 13px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 16px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: #c5cad6; }
tbody tr:last-child td { border-bottom: none; }
.keycell { display: flex; align-items: center; gap: 8px; }
.keycell code { background: var(--inset); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-size: 12.5px; }
.linkbtn { color: var(--accent2); cursor: pointer; background: none; border: none; font: inherit; padding: 0; }
.linkbtn:hover { text-decoration: underline; }
.danger { color: #ff8585; }

.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--green); background: rgba(155,230,160,0.08); }

/* ---------- Usage chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 16px 4px 0; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .bar .fill {
  width: 100%; border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  min-height: 4px; transition: height 0.4s;
}
.chart .bar .lbl { font-size: 11px; color: var(--muted); }

/* ---------- Billing ---------- */
.topup { display: flex; gap: 10px; flex-wrap: wrap; }
.topup .amt {
  border: 1px solid var(--border); background: var(--inset); border-radius: 12px;
  padding: 14px 20px; font-size: 16px; font-weight: 700; cursor: pointer; transition: border-color 0.15s;
}
.topup .amt:hover, .topup .amt.sel { border-color: var(--accent); }

/* ---------- Steps ---------- */
.steps { counter-reset: s; }
.steps .step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.steps .step:last-child { border-bottom: none; }
.steps .step .n {
  counter-increment: s; flex: none;
  width: 26px; height: 26px; border-radius: 50%; background: var(--inset); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--accent2);
}
.steps .step .n::before { content: counter(s); }
.steps .step h4 { margin: 2px 0 3px; font-size: 14px; }
.steps .step p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--inset); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 18px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 100; box-shadow: 0 16px 40px -20px rgba(0,0,0,0.7);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(5,6,9,0.7); backdrop-filter: blur(3px);
  display: none; place-items: center; z-index: 90;
}
.modal-bg.show { display: grid; }
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; width: 460px; max-width: calc(100vw - 40px);
}
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.modal .keyout {
  display: flex; gap: 8px; align-items: center;
  background: var(--inset); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-family: "JetBrains Mono", monospace; font-size: 13px; word-break: break-all; margin-bottom: 8px;
}
.input {
  width: 100%; background: var(--inset); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; font-family: inherit; margin-bottom: 14px;
}
.input:focus { outline: none; border-color: var(--accent); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; }
  .side .sep { display: none; }
  .main { padding: 24px 20px 70px; }
  .statgrid { grid-template-columns: 1fr; }
}
