* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f1419;
  color: #e7ecf3;
}
a { color: #7cb8ff; }
.hidden { display: none !important; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: #171d26;
  border: 1px solid #2a3342;
  border-radius: 12px;
  padding: 28px;
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-card p { margin: 0 0 20px; color: #98a7ba; font-size: 14px; }
label { display: block; font-size: 13px; color: #98a7ba; margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  background: #0f1419;
  border: 1px solid #2a3342;
  color: #e7ecf3;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
textarea { min-height: 160px; font-family: Consolas, monospace; font-size: 13px; }
button {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}
button.secondary { background: #2a3342; }
button.danger { background: #b42318; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
.error { color: #ff8a80; font-size: 13px; margin-bottom: 10px; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: #121820;
  border-right: 1px solid #2a3342;
  padding: 20px 16px;
}
.sidebar h2 { margin: 0 0 16px; font-size: 16px; }
.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  background: transparent;
  color: #c5d0de;
}
.nav-btn.active { background: #243044; color: #fff; }
.sidebar .logout { margin-top: 24px; width: 100%; }

.main { padding: 24px; }
.main h1 { margin: 0 0 16px; font-size: 22px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 120px; margin: 0; }
.hint { color: #98a7ba; font-size: 13px; margin: -6px 0 16px; }
.inline-select {
  width: auto;
  min-width: 110px;
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #171d26;
  border: 1px solid #2a3342;
  border-radius: 10px;
  overflow: hidden;
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #243044;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}
th { background: #121820; color: #98a7ba; font-weight: 600; }
tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #243044;
}
.badge.unused { background: #1e3a2f; color: #7dffb2; }
.badge.active { background: #1e2f4a; color: #7cb8ff; }
.badge.revoked { background: #3a1e1e; color: #ff8a80; }
.mono { font-family: Consolas, monospace; }
.cards-output {
  margin-top: 12px;
  padding: 12px;
  background: #0f1419;
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
  font-size: 13px;
}
