@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

* {
  box-sizing: border-box;
}
:root {
  --bg: #06101f;
  --bg-2: #0a1628;
  --panel: rgba(10, 20, 35, 0.82);
  --line: rgba(255,255,255,0.08);
  --text: #edf4ff;
  --muted: #9fb0cb;
  --accent: #58a6ff;
  --accent-2: #7d69ff;
  --success: #29d17d;
  --danger: #ff6d85;
  --warning: #ffb347;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 18px 70px rgba(0,0,0,0.35);
}
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: rgba(41, 209, 125, .10); border: 1px solid rgba(41, 209, 125, .2); color: #d4ffe7; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 14px var(--success); }


body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.25), transparent 30%),
    radial-gradient(circle at top right, rgba(139,92,246,0.25), transparent 30%),
    linear-gradient(135deg, #020617 0%, #0f172a 45%, #111827 100%);
  color: #e5e7eb;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
}

.topbar {
  margin: 18px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 22px;
  box-shadow:
    0 25px 80px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar p {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 14px;
  letter-spacing: 0.5px;
}

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

#adminEmail {
  color: #bae6fd;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.btn,
button {
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
  transition: all 0.25s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.45);
}

#logoutBtn {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 18px;
  padding: 10px 18px 18px;
  perspective: 1000px;
}

.card {
  position: relative;
  min-height: 125px;
  padding: 22px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92)),
    linear-gradient(135deg, #3b82f6, #8b5cf6);
  border: 1px solid rgba(125, 211, 252, 0.22);
  box-shadow:
    0 22px 45px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.08);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
  color: #e0f2fe;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(56,189,248,0.4), rgba(168,85,247,0.25), transparent);
  opacity: 0.55;
  z-index: -1;
}

.card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -35px;
  bottom: -35px;
  background: radial-gradient(circle, rgba(56,189,248,0.4), transparent 65%);
}

.card:hover {
  transform: rotateX(7deg) rotateY(-7deg) translateY(-8px);
  box-shadow:
    0 32px 70px rgba(37, 99, 235, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.filters {
  margin: 0 18px 18px;
  padding: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.32);
  backdrop-filter: blur(16px);
}

.filters input {
  min-width: 160px;
  flex: 1;
  padding: 13px 14px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 13px;
  background: rgba(2, 6, 23, 0.72);
  color: #e5e7eb;
  outline: none;
  transition: all 0.25s ease;
}

.filters input::placeholder {
  color: #64748b;
}

.filters input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.table-container {
  margin: 0 18px 30px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 22px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.42);
  backdrop-filter: blur(18px);
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

thead th {
  padding: 14px;
  color: #93c5fd;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.2);
}

tbody tr {
  background: rgba(30, 41, 59, 0.72);
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  transition: all 0.22s ease;
  cursor: pointer;
}

tbody tr:hover {
  transform: scale(1.01);
  background: rgba(30, 64, 175, 0.35);
  box-shadow: 0 18px 45px rgba(59, 130, 246, 0.2);
}

td {
  padding: 15px 14px;
  color: #dbeafe;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  font-size: 14px;
}

td:first-child {
  border-radius: 14px 0 0 14px;
}

td:last-child {
  border-radius: 0 14px 14px 0;
  color: #94a3b8;
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
}

.modal-content {
  position: relative;
  width: min(1100px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(15,23,42,0.96), rgba(30,41,59,0.96));
  border: 1px solid rgba(56,189,248,0.28);
  box-shadow:
    0 30px 100px rgba(0,0,0,0.65),
    0 0 45px rgba(59,130,246,0.2);
}

.modal-table-container {
  margin-top: 14px;
  padding: 12px;
  max-height: 330px;   /* shows around 4-5 logs */
  overflow-y: auto;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 18px;
}

.modal-table-container table {
  min-width: 850px;
}

#closeModal {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 30px;
  cursor: pointer;
  color: #f87171;
}

#modalData h2 {
  margin-top: 0;
  color: #38bdf8;
}

#modalData p {
  color: #cbd5e1;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.hidden {
  display: none;
}

@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .cards {
    grid-template-columns: repeat(1, 1fr);
  }

  .filters input,
  .filters button {
    width: 100%;
  }
}

/* =========================
   LOGIN PAGE ONLY
========================= */

.login-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 520px);
  padding: 34px;
  background: rgba(10, 20, 35, 0.82);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 26px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 70px rgba(0,0,0,0.35);
}

.eyebrow {
  margin: 0 0 10px;
  color: #6fdcff;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  font-weight: 700;
}

.login-card h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -.03em;
  color: #edf4ff;
}

.subtext {
  color: #9fb0cb;
  line-height: 1.7;
  margin-top: 14px;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #dce8ff;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(5, 12, 22, .7);
  color: #edf4ff;
  outline: none;
  transition: 0.2s ease;
}

.field input:focus {
  border-color: rgba(88,166,255,.6);
  box-shadow: 0 0 0 4px rgba(88,166,255,.12);
}

.field input::placeholder {
  color: #64748b;
}

.turnstile-row {
  padding-top: 6px;
}

.btn-block {
  width: 100%;
}

.error-text {
  min-height: 20px;
  color: #ff98a8;
  font-size: 13px;
  margin: 0;
}

/* Optional animated background */

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 90%);
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: rgba(88,166,255,.18);
  top: 60px;
  left: -40px;
}

.orb-b {
  width: 340px;
  height: 340px;
  background: rgba(125,105,255,.16);
  right: -50px;
  bottom: 30px;
}

@media (max-width: 720px) {
  .login-card {
    padding: 22px;
  }

  .login-card h2 {
    font-size: 28px;
  }
}