:root {
  --bg: #07121e;
  --card: rgba(9, 27, 45, 0.78);
  --text: #eef4ff;
  --muted: #9cb2cb;
  --accent: #f46036;
  --accent-2: #2fbf71;
  --warn: #f4b942;
  --danger: #f94144;
  --line: #214463;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 16%, #254a77 0, transparent 34%),
    radial-gradient(circle at 88% 8%, #4d2a4f 0, transparent 30%),
    linear-gradient(122deg, #061019, #0b1f36 42%, #10241d 100%);
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.38;
  pointer-events: none;
}

.bg-shape.one {
  width: 280px;
  height: 280px;
  background: #fc466b;
  top: -70px;
  left: -60px;
}

.bg-shape.two {
  width: 340px;
  height: 340px;
  background: #3f5efb;
  bottom: -140px;
  right: -120px;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 45px rgba(4, 8, 15, 0.4);
  margin-bottom: 14px;
  animation: slideIn 0.35s ease both;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  font-size: 44px;
  margin-bottom: 10px;
}

h2 {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.8px;
  font-size: 36px;
  margin-bottom: 4px;
}

h3 {
  color: #dbe5f2;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0;
  color: #82b6f2;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 11px;
  font-weight: 800;
}

.subtitle {
  margin-top: 0;
  margin-bottom: 10px;
  color: #c0d2e6;
}

label {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  color: var(--muted);
}

input,
select,
button {
  width: 100%;
  border: 1px solid var(--line);
  background: #0a1a2d;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

button {
  background: linear-gradient(135deg, var(--accent), #ef8354);
  border: 0;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(244, 96, 54, 0.25);
}

button.ghost {
  width: auto;
  background: #10273f;
  border: 1px solid var(--line);
}

button.warn {
  background: linear-gradient(135deg, var(--warn), #f4845f);
}

button.safe {
  background: linear-gradient(135deg, var(--accent-2), #20a4f3);
}

button.danger {
  background: linear-gradient(135deg, var(--danger), #c1121f);
}

.error {
  color: #ff8fa3;
}

.flash {
  margin-top: 0;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(18, 47, 73, 0.7);
  border: 1px solid #29527a;
  color: #dbe9ff;
  display: none;
}

.flash.visible {
  display: block;
}

.hidden {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  margin-bottom: 0;
  background:
    linear-gradient(165deg, rgba(12, 35, 56, 0.9), rgba(7, 20, 34, 0.82)),
    radial-gradient(circle at 90% 10%, rgba(47, 191, 113, 0.2), transparent 50%);
}

.stat-card p {
  margin: 0;
  color: #9ec0de;
  font-size: 12px;
}

.stat-card strong {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.table-wrap {
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1000px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 12px;
}

th {
  color: #b9cae0;
  text-align: left;
}

.actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.actions-row button {
  width: auto;
  padding: 7px 10px;
  font-size: 12px;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.tag.active {
  background: rgba(47, 191, 113, 0.2);
  color: #8ef0b8;
  border: 1px solid rgba(47, 191, 113, 0.35);
}

.tag.revoked {
  background: rgba(244, 185, 66, 0.2);
  color: #ffd98f;
  border: 1px solid rgba(244, 185, 66, 0.35);
}

.tag.deleted {
  background: rgba(249, 65, 68, 0.2);
  color: #ff9fa1;
  border: 1px solid rgba(249, 65, 68, 0.35);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 860px) {
  .app {
    padding: 30px;
  }

  .grid {
    grid-template-columns: 1.4fr 0.6fr 1fr 0.5fr;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .login-card {
    max-width: 500px;
    margin: 10vh auto;
  }
}
