/* Basic layout */
body.admin-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050505;
  color: #f0f0f0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */

.admin-sidebar {
  background: #070707;
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

.admin-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #15fb00;
}

/* Sidebar brand header (Control Room area) */
.admin-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-logo-sub {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #b9ffb1;
  opacity: 0.95;
}

.admin-welcome {
  margin: 0;
  font-size: 0.9rem;
  color: #ccc;
}

.admin-current-role {
  font-size: 0.85rem;
  color: #aaa;
}

.admin-current-role {
  font-size: 0.9rem;
  color: #ccc;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav-item {
  background: transparent;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  color: #eee;
  font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s;
}

.admin-nav-item:hover {
  background: #111;
  border-color: #15fb00;
}

.admin-nav-item.active {
  background: #15fb00;
  color: #000;
  border-color: #15fb00;
}

.admin-sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-sidebar-footer button {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #eee;
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-sidebar-footer button:hover {
  border-color: #15fb00;
}

/* Main content */

.admin-main {
  padding: 16px 20px;
  padding-top: 10px;
}

/* Top bar */

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.4rem;
}

.admin-topbar p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #ccc;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
  border: 1px solid #555;
}

.pill-admin {
  background: #15fb00;
  color: #000;
}

/* Sections */

.admin-section {
  margin-bottom: 32px;
}

.admin-section.hidden {
  display: none;
}

/* Cards & grid */

.card {
  background: #101010;
  border-radius: 8px;
  border: 1px solid #222;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.card-danger {
  border-color: #ff0044;
  background: #290010;
}

.card h3 {
  margin-top: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

/* Lists */

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.list-item {
  background: #171717;
  border-radius: 6px;
  border: 1px solid #333;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.list-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* Buttons */

.ghost-btn,
.list-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #eee;
  font-size: 0.8rem;
  cursor: pointer;
}

.ghost-btn:hover,
.list-btn:hover {
  border-color: #15fb00;
}

/* Inline forms */

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inline-form input,
.inline-form select {
  flex: 1;
  min-width: 160px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

input,
select,
textarea {
  background: #0b0b0b;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 8px;
  color: #f0f0f0;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  resize: vertical;
}

button {
  font-family: inherit;
}

/* Tabs */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tab-btn {
  padding: 6px 10px;
  border-radius: 100px;
  border: 1px solid #333;
  background: #111;
  color: #eee;
  font-size: 0.85rem;
  cursor: pointer;
}

.tab-btn.active {
  background: #15fb00;
  color: #000;
  border-color: #15fb00;
}

.tab-content.hidden {
  display: none;
}

/* Small note text */

.small-note {
  font-size: 0.8rem;
  color: #aaa;
}

@media (max-width: 800px) {
  .admin-layout {
    grid-template-columns: 1fr; /* sidebar becomes top section */
  }

  /* Keep stacked layout (not row) */
  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid #222;
    padding: 14px;
  }

  .admin-nav {
    flex-direction: column;
  }

  .admin-nav-item {
    width: 100%;
  }

  .admin-main {
    padding: 14px;
  }
}

.admin-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-logo-sub {
  font-size: 0.95rem;
  color: #9cff92;
  font-weight: 600;
}

.admin-welcome {
  margin: 10px 0 6px;
  font-size: 0.9rem;
  color: #ccc;
}

.log-group-title{
  margin: 14px 0 6px;
  font-size: 0.85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #15fb00;
  opacity: .95;
}

/* ===== Support ticket popup / modal ===== */

.ticket-tabs {
  flex-wrap: wrap;
}

.ticket-modal.hidden {
  display: none;
}

.ticket-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
}

.ticket-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.ticket-modal-dialog {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 20px auto;
  border: 1px solid rgba(21, 251, 0, 0.28);
  box-shadow:
    0 18px 60px rgba(0,0,0,0.65),
    0 0 20px rgba(21,251,0,0.10);
}

.ticket-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 3;
  padding-bottom: 10px;
  margin-bottom: 12px;
  background: #101010;
  border-bottom: 1px solid #222;
}

body.ticket-modal-open {
  overflow: hidden;
}

.ticket-thread-wrap {
  margin-top: 10px;
}

.ticket-thread-wrap .card {
  margin-bottom: 10px;
}

.ticket-detail-meta p {
  margin: 0 0 10px;
}

.ticket-response-box {
  width: 100%;
  min-height: 120px;
}

@media (max-width: 800px) {
  .ticket-modal-dialog {
    width: calc(100vw - 16px);
    margin: 8px auto;
    max-height: calc(100vh - 16px);
  }

  .ticket-modal-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.ticket-modal-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-modal-header-actions .list-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== Account deletion insights ===== */

.delete-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.delete-summary-chip {
  padding: 10px 12px;
  border: 1px solid rgba(21, 251, 0, 0.14);
  border-radius: 10px;
  background: #0c0c0c;
}

.delete-summary-chip span {
  display: block;
  font-size: 0.82rem;
  color: #b9c7b9;
}

.delete-summary-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  color: #15fb00;
}

.delete-feedback-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  opacity: 0.9;
}

.delete-feedback-reason {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.delete-feedback-message {
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.45;
}

@media (max-width: 800px) {
  .delete-feedback-meta {
    flex-direction: column;
  }
}