:root {
  color-scheme: dark;
  --bg: #06070a;
  --panel: #101217;
  --panel-soft: #151922;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f7fb;
  --muted: rgba(244, 247, 251, 0.55);
  --accent: #ff2e46;
  --success: #2ef2a1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(255, 46, 70, 0.16), transparent 34rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(16, 18, 23, 0.88);
  padding: 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

h1,
h2,
p {
  margin-top: 0;
}

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

label {
  display: grid;
  gap: 8px;
  color: rgba(244, 247, 251, 0.72);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

button,
.logout {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

button:hover,
.logout:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

button.primary,
.login-card button {
  border-color: transparent;
  background: var(--accent);
  color: white;
}

button.danger {
  color: #ff9aa8;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}

.topbar h1 {
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.shell {
  display: grid;
  gap: 22px;
  padding: 28px clamp(20px, 5vw, 64px) 56px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(16, 18, 23, 0.86);
  padding: 22px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title h2 {
  margin-bottom: 6px;
}

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

.wide {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
}

.checkbox-row input {
  width: auto;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
}

.alert.success {
  border: 1px solid rgba(46, 242, 161, 0.28);
  background: rgba(46, 242, 161, 0.1);
  color: var(--success);
}

.alert.error {
  border: 1px solid rgba(255, 46, 70, 0.28);
  background: rgba(255, 46, 70, 0.1);
  color: #ff9aa8;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 14px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: rgba(244, 247, 251, 0.42);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td span {
  color: var(--muted);
  font-size: 12px;
}

code {
  display: inline-block;
  color: #ffffff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.key-cell {
  min-width: 250px;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.pill {
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.status.active {
  background: rgba(46, 242, 161, 0.1);
  color: var(--success);
}

.status.expired {
  background: rgba(255, 183, 77, 0.12);
  color: #ffcf82;
}

.status.revoked {
  background: rgba(255, 46, 70, 0.12);
  color: #ff9aa8;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions form {
  margin: 0;
}

@media (max-width: 900px) {
  .grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }
}

