:root {
  --blue: #12349a;
  --blue2: #2458e6;
  --line: #e6ebf4;
  --muted: #71809e;
  --danger: #e44242;
  --ok: #16a26a;
  --bg: #f4f7fc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #15213b;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}
header img {
  width: 42px;
}
header h1 {
  font-size: 18px;
  margin: 0;
  flex: 1;
}
main {
  padding: 16px;
  max-width: 1300px;
  margin: auto;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.narrow {
  max-width: 380px;
  margin: 40px auto;
}
label {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  color: var(--muted);
}
input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  margin-top: 4px;
}
button {
  font: inherit;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}
.primary {
  background: var(--blue2);
  color: #fff;
}
.ghost {
  background: #eef2fb;
  color: var(--blue);
}
.danger {
  background: #fde8e8;
  color: var(--danger);
}
.hidden {
  display: none !important;
}
.msg {
  color: var(--danger);
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar input {
  width: auto;
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.kpi b {
  display: block;
  font-size: 24px;
}
.wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}
th,
td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 600;
}
.tag {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  background: #eef2fb;
}
.tag.trial {
  background: #fff3cd;
}
.tag.active {
  background: #dcf7ea;
  color: var(--ok);
}
.tag.suspended,
.tag.expired {
  background: #fde8e8;
  color: var(--danger);
}
dialog {
  border: 0;
  border-radius: 16px;
  padding: 18px;
  width: min(520px, 96vw);
}
dialog .close {
  text-align: left;
  margin: 0;
}
dialog .close button {
  background: none;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
.secret {
  background: #fff8e1;
  border: 1px dashed #e0b400;
  padding: 12px;
  border-radius: 10px;
  font-family: monospace;
  direction: ltr;
  text-align: left;
}
#toast {
  position: fixed;
  bottom: 18px;
  left: 18px;
  background: #15213b;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  display: none;
}

/* ---------- login screen, same look as the store login ---------- */
body:has(.auth) header {
  display: none;
}
body:has(.auth) main {
  padding: 0;
  max-width: none;
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: #fff;
}
.auth-art {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #071d68 0%, #12349a 52%, #2060e7 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 60px;
  text-align: center;
}
.auth-art:after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent);
}
.auth-logo {
  width: min(420px, 74%);
  position: relative;
  z-index: 2;
  background: #fff;
  padding: 20px 26px;
  border-radius: 26px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.22);
}
.auth-art h1 {
  font-size: 30px;
  margin: 38px 0 10px;
  position: relative;
  z-index: 2;
}
.auth-art p {
  font-size: 16px;
  opacity: 0.85;
  position: relative;
  z-index: 2;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
  background: linear-gradient(135deg, #ff8a00, #ff3d00);
  opacity: 0.72;
}
.orb.one {
  width: 290px;
  height: 290px;
  top: -120px;
  right: -80px;
}
.orb.two {
  width: 170px;
  height: 170px;
  bottom: -55px;
  left: 40px;
}
.auth-card {
  width: min(420px, 86%);
  margin: auto;
}
.eyebrow {
  display: inline-block;
  color: #ff5a1f;
  background: #fff1ea;
  border-radius: 99px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
}
.auth-card h2 {
  font-size: 32px;
  margin: 16px 0 6px;
}
.auth-card .sub {
  color: var(--muted);
  margin: 0 0 26px;
}
.auth-card label {
  font-weight: 700;
  font-size: 13px;
  color: #15213b;
  margin: 16px 0 8px;
}
.auth-card input {
  height: 50px;
  border-radius: 14px;
  border: 1px solid #dbe3f1;
  background: #f8faff;
  padding: 0 14px;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-card input:focus {
  outline: 0;
  border-color: #2458e6;
  box-shadow: 0 0 0 4px rgba(36, 88, 230, 0.12);
  background: #fff;
}
.wide {
  width: 100%;
  height: 52px;
  margin-top: 26px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(36, 88, 230, 0.28);
}
.primary:hover {
  filter: brightness(1.06);
}
@media (max-width: 820px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 36px 20px 30px;
  }
  .auth-art h1 {
    font-size: 22px;
    margin-top: 24px;
  }
  .auth-art p {
    display: none;
  }
  .auth-card {
    padding: 26px 0 40px;
  }
}

/* ---------- console polish ---------- */
header img {
  width: auto;
  height: 38px;
}
header h1 {
  font-weight: 800;
}
#who {
  color: var(--muted);
  font-size: 14px;
}
.card,
.kpi {
  box-shadow: 0 6px 22px rgba(18, 52, 154, 0.06);
}
.kpi b {
  color: var(--blue);
  margin-top: 4px;
}
th {
  background: #f8faff;
}
tr:hover td {
  background: #fbfcff;
}
dialog {
  box-shadow: 0 30px 80px rgba(7, 29, 104, 0.28);
}
dialog::backdrop {
  background: rgba(7, 29, 104, 0.35);
  backdrop-filter: blur(2px);
}
