:root {
  --bg: #060a12;
  --bg-soft: #0a1120;
  --panel: rgba(15, 24, 40, 0.86);
  --panel-solid: #0e1728;
  --panel-2: #121e33;
  --line: rgba(148, 163, 184, 0.13);
  --line-strong: rgba(148, 163, 184, 0.24);
  --text: #e8eef9;
  --muted: #91a1ba;
  --dim: #62718a;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --violet: #a78bfa;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 800px at 12% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(1000px 700px at 95% 0%, rgba(129, 140, 248, 0.12), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(167, 139, 250, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(34, 211, 238, 0.28);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.65);
  outline-offset: 2px;
}

/* ---------- boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  z-index: 100;
  transition: opacity 0.35s ease;
}

.boot.hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: #051018;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 60px rgba(34, 211, 238, 0.35);
  animation: breathe 2s ease-in-out infinite;
}

.boot-text {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.94);
    opacity: 0.75;
  }
}

/* ---------- login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 64px clamp(40px, 7vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
}

.login-brand::before {
  content: "";
  position: absolute;
  width: 660px;
  height: 660px;
  right: -200px;
  top: -220px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 42%, rgba(34, 211, 238, 0.2), rgba(129, 140, 248, 0.12) 45%, transparent 70%);
  filter: blur(26px);
  pointer-events: none;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 35% 35%, #000 0%, transparent 70%);
  pointer-events: none;
}

.brand-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #041018;
  font-weight: 800;
  font-size: 21px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.25);
}

.brand-name {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.16em;
}

.login-hero {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 40px 0;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  background: rgba(34, 211, 238, 0.06);
}

.login-hero h1 {
  margin: 26px 0 18px;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 680;
}

.login-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 60%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-hero p {
  color: var(--muted);
  font-size: 15px;
  max-width: 520px;
  margin: 0;
}

.login-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 38px;
}

.login-point {
  border: 1px solid var(--line);
  background: rgba(10, 17, 32, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 16px;
}

.login-point strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 600;
}

.login-point span {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

.login-foot {
  position: relative;
  z-index: 1;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: linear-gradient(180deg, rgba(10, 17, 32, 0.5), rgba(6, 10, 18, 0.9));
}

.login-card {
  width: min(400px, 100%);
  animation: rise 0.5s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-card h2 {
  font-size: 24px;
  margin: 0 0 6px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.login-card .login-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 30px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-hint {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--dim);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- shell ---------- */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(8, 13, 24, 0.72);
  backdrop-filter: blur(18px);
  padding: 22px 16px 16px;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 24px;
}

.sidebar-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
}

.sidebar-brand .brand-name {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
}

.nav-label {
  padding: 0 12px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 10px 0 8px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.18s ease;
  position: relative;
  font-size: 13.5px;
  background: none;
  text-align: left;
  width: 100%;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  opacity: 0.85;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.06);
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(129, 140, 248, 0.06));
  border-color: rgba(34, 211, 238, 0.2);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.admin-chip:hover {
  background: rgba(148, 163, 184, 0.05);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 13px;
  color: #eaf8ff;
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.28), rgba(129, 140, 248, 0.3));
  border: 1px solid rgba(34, 211, 238, 0.25);
  flex: none;
}

.avatar.lg {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 18px;
}

.admin-meta {
  min-width: 0;
  flex: 1;
}

.admin-meta strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-meta span {
  display: block;
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  transition: 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.06);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px clamp(20px, 3.4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(18px);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.01em;
  font-weight: 620;
}

.topbar-title p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view {
  padding: clamp(20px, 3vw, 34px) clamp(20px, 3.4vw, 42px) 48px;
  animation: fade 0.28s ease both;
  max-width: 1560px;
  width: 100%;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mobile-menu {
  display: none;
}

/* ---------- common ---------- */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-actions h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.page-actions p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 12px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions > .select,
.actions > .input {
  width: auto;
  min-width: 148px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  transition: 0.18s ease;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.34);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #38bdf8 55%, var(--accent-2));
  border-color: transparent;
  color: #041018;
  font-weight: 650;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.18);
}

.btn-primary:hover {
  filter: brightness(1.06);
  background: linear-gradient(135deg, var(--accent), #38bdf8 55%, var(--accent-2));
}

.btn-danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.08);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.16);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
  height: 42px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

.card-pad {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}

.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.card-head p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 11.5px;
}

.card-body {
  padding: 18px 20px 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-2-1 {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: -0.01em;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ---------- stats ---------- */
.stat {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
}

.stat::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -50px;
  top: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 70%);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.stat-label svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.stat-value {
  margin-top: 12px;
  font-size: 30px;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 11.5px;
}

.stat-foot .up {
  color: var(--green);
}

.stat-foot .warn {
  color: var(--amber);
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
  color: var(--muted);
}

.chart-legend i {
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.bar-item {
  display: grid;
  gap: 6px;
}

.bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.bar-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.1);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s ease;
}

/* ---------- table ---------- */
.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.data th {
  text-align: left;
  font-weight: 500;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  vertical-align: middle;
}

table.data tbody tr {
  transition: background 0.15s ease;
}

table.data tbody tr:hover {
  background: rgba(148, 163, 184, 0.035);
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tr.clickable {
  cursor: pointer;
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cell-main .avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 11px;
}

.cell-title {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.cell-sub {
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.chip.accent {
  color: var(--accent);
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.active,
.badge.used_ok {
  color: var(--green);
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.2);
}

.badge.paused,
.badge.unused,
.badge.pending {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}

.badge.disabled,
.badge.revoked,
.badge.expired,
.badge.failed {
  color: var(--red);
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.2);
}

.badge.archived,
.badge.used {
  color: var(--dim);
  background: rgba(148, 163, 184, 0.06);
  border-color: var(--line);
}

.badge.tier {
  color: var(--violet);
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.2);
}

.badge.tier::before {
  display: none;
}

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--dim);
}

.empty .empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.04);
  color: var(--muted);
}

.empty .empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty strong {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.empty p {
  margin: 0 auto 18px;
  max-width: 360px;
  font-size: 12px;
}

/* ---------- forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field label .req {
  color: var(--red);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(6, 10, 18, 0.6);
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  transition: 0.16s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #4e5d74;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.input:disabled,
.select:disabled {
  opacity: 0.55;
}

.textarea {
  min-height: 74px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-hint {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.6;
}

.form-error {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.07);
  color: #fca5a5;
  font-size: 12px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 18, 0.6);
  margin: 1px 0 0;
  flex: none;
  position: relative;
}

.check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.check input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #041018;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.filter-bar .input,
.filter-bar .select {
  height: 34px;
  min-height: 34px;
  font-size: 12px;
  width: auto;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 380px;
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--dim);
}

.search-box .input {
  padding-left: 31px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
}

.pagination .actions {
  gap: 6px;
}

/* ---------- products ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.product-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 160px at 100% 0%, rgba(129, 140, 248, 0.08), transparent 70%);
  pointer-events: none;
}

.product-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.product-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.16), rgba(129, 140, 248, 0.14));
  border: 1px solid rgba(34, 211, 238, 0.18);
  color: var(--accent);
  flex: none;
}

.product-icon svg {
  width: 20px;
  height: 20px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.product-code {
  color: var(--dim);
  font-size: 11px;
  font-family: var(--mono);
}

.product-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-foot .actions {
  justify-content: flex-end;
}

.product-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 11px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.product-stat {
  text-align: center;
}

.product-stat strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.product-stat span {
  color: var(--dim);
  font-size: 10.5px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kv span {
  color: var(--dim);
  font-size: 10.5px;
}

.kv strong {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-line {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 10, 18, 0.45);
  padding: 5px 8px;
  min-width: 0;
}

.copy-line code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ---------- modal / drawer ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 22px;
  animation: fade 0.18s ease both;
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #101b2e, #0a1220);
  box-shadow: var(--shadow);
  animation: pop 0.22s ease both;
}

.modal.wide {
  width: min(760px, 100%);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  padding: 20px 22px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 12px;
}

.modal-head .icon-btn {
  margin-left: auto;
}

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
}

.modal-foot {
  padding: 0 22px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 6, 12, 0.58);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  animation: fade 0.18s ease both;
}

.drawer {
  width: min(640px, 100%);
  height: 100%;
  background: linear-gradient(180deg, #0d1728, #080f1c);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  animation: slide 0.24s ease both;
}

@keyframes slide {
  from {
    transform: translateX(30px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.drawer-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  padding: 18px 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  border: none;
  background: none;
  color: var(--dim);
  padding: 9px 12px;
  font-size: 12.5px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.detail-hero h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 620;
}

.detail-hero .sub {
  color: var(--dim);
  font-size: 11.5px;
  font-family: var(--mono);
}

/* ---------- toast ---------- */
.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 23, 40, 0.96);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.24s ease both;
  pointer-events: auto;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
}

.toast.success svg {
  color: var(--green);
}

.toast.error svg {
  color: var(--red);
}

.toast.info svg {
  color: var(--accent);
}

.toast.out {
  animation: toastOut 0.2s ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- code / secret ---------- */
.secret-box {
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.06);
  border-radius: 12px;
  padding: 14px;
}

.secret-box .label {
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-block {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  background: rgba(3, 7, 14, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  color: #b9d7e8;
  white-space: pre;
}

.codes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.code-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.55);
  user-select: all;
}

.callout {
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.05);
  border-radius: 11px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.callout.warn {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.05);
}

.callout.danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.05);
}

.callout strong {
  color: var(--text);
  font-weight: 600;
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 11px;
  padding: 9px 0;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 32px;
  bottom: -4px;
  width: 1px;
  background: var(--line);
}

.timeline-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.18);
  color: var(--accent);
  font-size: 10px;
}

.timeline-dot svg {
  width: 13px;
  height: 13px;
}

.timeline-body {
  min-width: 0;
}

.timeline-body strong {
  font-size: 12px;
  font-weight: 500;
}

.timeline-body span {
  display: block;
  color: var(--dim);
  font-size: 10.5px;
}

/* ---------- spinner ---------- */
.spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- skeleton ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.06);
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.08), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.skeleton-row {
  height: 44px;
  margin: 8px 16px;
}

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2-1 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login-brand {
    display: none;
  }
  .login-panel {
    min-height: 100vh;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-102%);
    transition: transform 0.24s ease;
    background: #08101d;
  }
  .shell.nav-open .sidebar {
    transform: none;
  }
  .shell.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 12, 0.6);
    z-index: 25;
  }
  .mobile-menu {
    display: inline-grid;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: auto;
  }
  .codes-grid {
    grid-template-columns: 1fr;
  }
  .view {
    padding-bottom: 32px;
  }
  .topbar {
    padding: 14px 18px;
  }
}

@media (max-width: 640px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .login-points {
    grid-template-columns: 1fr;
  }
  .stat-value {
    font-size: 26px;
  }
  .login-panel {
    padding: 24px;
  }
  .topbar-title p {
    display: none;
  }
  .drawer {
    width: 100%;
  }
  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }
  .modal {
    max-height: calc(100vh - 24px);
  }
  .modal-foot {
    flex-wrap: wrap;
  }
  .modal-foot .btn {
    flex: 1;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar .search-box {
    max-width: none;
    width: 100%;
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
