:root {
  --bg: #0b0712;
  --ink: #efe9ff;
  --accent: #8a5cff;
  --accent-2: #5b2fc2;
  --card: #151022;
  --muted: #a697c7;
  --line: #2a1f40;
  --danger: #d64545;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Noto Sans", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, #201438, var(--bg));
  min-height: 100vh;
  background-attachment: fixed;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
.login-wrap {
  max-width: 480px;
  padding-top: 6vh;
}
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.5px;
}
header p { color: var(--muted); margin: 0; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #1a142b;
}
.card h3 { margin: 0 0 8px 0; }
label { display: block; font-size: 13px; margin: 6px 0; color: var(--muted); }
.hint {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 12px;
}
input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #0f0b17;
  color: var(--ink);
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
button, .btn {
  margin-top: 8px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.danger { background: var(--danger); }
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
button.download {
  background: #2e7cff;
  border: 1px solid #1b4fa3;
}
button.delete {
  background: var(--danger);
  border: 1px solid #7f1f1f;
}

.table {
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th { color: var(--muted); font-weight: 600; }

td.actions, th.actions { width: 260px; }
.actions { white-space: nowrap; }
form.inline { display: inline-block; margin-right: 6px; }
.actions button { margin-top: 0; }

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge.valid { background: rgba(138, 92, 255, 0.2); color: #cbb5ff; border: 1px solid #5b2fc2; }
.badge.revoked { background: rgba(255, 83, 83, 0.2); color: #ff9a9a; border: 1px solid #b63b3b; }
.badge.expired { background: rgba(255, 186, 73, 0.2); color: #ffd7a0; border: 1px solid #b06a14; }

.footer {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 0 0;
}
.raven {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #120d1f;
  letter-spacing: 0.4px;
  margin-right: 6px;
}
.credit {
  display: inline-block;
  font-weight: 600;
  color: #cbb5ff;
  letter-spacing: 0.6px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-card {
  width: min(420px, 90vw);
  background: #160f26;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.hidden { display: none; }

.login {
  max-width: 360px;
  margin: 10vh auto 0;
  text-align: left;
}
.muted { color: var(--muted); margin-top: 4px; }
.error {
  background: rgba(255, 83, 83, 0.15);
  border: 1px solid #b63b3b;
  color: #ffb1b1;
  padding: 8px;
  border-radius: 8px;
  margin: 10px 0;
}

@media (max-width: 720px) {
  header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .fields { grid-template-columns: 1fr; }
}
