* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #e8eef7;
  background:
    radial-gradient(circle at top left, rgba(55, 97, 145, 0.35), transparent 28rem),
    linear-gradient(135deg, #101722, #05070a);
  min-height: 100vh;
}

a {
  color: #79b7ff;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin: 0;
}

.topbar p {
  margin: 0.35rem 0 0;
  color: #aeb9c8;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}

.search-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

input,
select,
textarea {
  flex: 1;
  min-width: 190px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(0,0,0,0.32);
  color: #fff;
}

textarea {
  min-height: 90px;
  width: 100%;
}

button,
.button {
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: #2f80ed;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.button:hover {
  filter: brightness(1.1);
}

button.danger {
  background: #b83333;
}

.button.ghost {
  background: rgba(255,255,255,0.12);
}

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.tag,
.pill {
  background: rgba(255,255,255,0.14);
  color: #dbe9ff;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
}

.result {
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.result-top,
.section-title,
.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.result h3 {
  margin: 0;
}

.muted {
  color: #aeb9c8;
}

.grid {
  display: grid;
  gap: 0.75rem;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

pre {
  white-space: pre-wrap;
  background: rgba(0,0,0,0.35);
  border-radius: 10px;
  padding: 1rem;
  overflow: auto;
}

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

  .search-row {
    flex-direction: column;
  }

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

.login-badge {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.18);
}

.login-badge-in {
  background: rgba(38, 166, 91, 0.22);
  color: #8ff0b0;
  border-color: rgba(143, 240, 176, 0.45);
}

.login-badge-out {
  background: rgba(220, 70, 70, 0.22);
  color: #ffaaaa;
  border-color: rgba(255, 170, 170, 0.45);
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  position: sticky;
  top: 84px;
  z-index: 5;
  padding: 0.5rem;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}

.tab-button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
}

.tab-button.active {
  background: #2f80ed;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.admin-details {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 12px;
  padding: 0.75rem;
  margin: 0.75rem 0;
}

.admin-details summary {
  cursor: pointer;
  font-weight: 700;
}

.details-body {
  margin-top: 0.75rem;
}

.compact-results {
  display: grid;
  gap: 0.55rem;
}

.compact-card {
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 14px;
  overflow: hidden;
}

.compact-card summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1rem;
}

.compact-card summary::-webkit-details-marker {
  display: none;
}

.compact-card summary::before {
  content: "▶";
  margin-right: 0.45rem;
  color: #aeb9c8;
}

.compact-card[open] summary::before {
  content: "▼";
}

.compact-title {
  flex: 1;
  font-weight: 700;
}

.compact-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 640px) {
  .admin-tabs {
    top: 0;
    position: relative;
  }

  .compact-card summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.research-status {
  margin-top: 0.9rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(121, 183, 255, 0.35);
  background: rgba(47, 128, 237, 0.16);
}

.research-status.hidden,
.hidden {
  display: none;
}

.preview-details {
  margin-top: 0.75rem;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.65rem;
}

.preview-details summary {
  cursor: pointer;
  font-weight: 700;
}

.preview-frame-wrap {
  margin-top: 0.65rem;
  width: 100%;
  height: 360px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 640px) {
  .preview-frame-wrap {
    height: 280px;
  }
}

.cleanup-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.cleanup-actions button {
  width: 100%;
}

.cleanup-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.cleanup-actions button {
  width: 100%;
}
