body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #f4f6f8;
}

.admin-container {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: #1c3144;
  color: #fff;
  padding: 20px;
}

.admin-sidebar h2 {
  margin-top: 0;
}

.admin-sidebar nav a {
  display: block;
  padding: 10px 0;
  color: #cfe0f5;
  text-decoration: none;
}

.admin-sidebar nav a:hover {
  color: #fff;
}

.admin-main {
  flex: 1;
  padding: 25px;
}

.admin-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.admin-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.05);
  transition: 0.2s;
}

.admin-card.full {
  grid-column: 1 / -1; /* Forces full row */
  width: 100%;
  max-width: 900px; /* Makes it readable */
  margin: 0 auto; /* Centers it */
}

.admin-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.system-item {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.health-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  color: white;
}
.health-green {
  background: #2ecc71;
}
.health-yellow {
  background: #f1c40f;
  color: #333;
}
.health-red {
  background: #e74c3c;
}

/* Expandable card */
.expandable {
  cursor: pointer;
  user-select: none;
}

#details-content p {
  margin: 6px 0;
  line-height: 1.4;
  white-space: normal; /* Prevent text overflow */
  word-wrap: break-word;
}

.details-hidden {
  display: none;
}

.details-visible {
  display: block;
  margin-top: 12px;
}

.expandable h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.more-details-card {
  overflow-y: auto;
  max-height: 350px; /* keeps card from growing downward */
  padding-right: 10px; /* prevents text from hugging the edge */
}

.more-details-card p,
.more-details-card div {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.35;
}
/* LOG VIEWER
---------------------------------------*/

.log-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.log-form label {
  font-size: 0.9rem;
}

.log-form select,
.log-form button {
  margin-left: 4px;
}

.log-form button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.log-refresh-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

.log-meta {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #666;
}

.log-viewer {
  max-height: 450px;
  overflow: auto;
  font-family: monospace;
}

.log-content {
  margin: 0;
  white-space: pre-wrap;
}

/* Per-line highlighting */
.log-line {
  display: block;
}

.log-line.error {
  color: #b00020;
  font-weight: 600;
}

.log-line.warn {
  color: #b8860b;
}

.log-line.info {
  color: #555;
}

.log-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
}
/* LOG VIEWER LAYOUT ----------------------------------------- */

.logs-container {
  display: flex;
  gap: 32px;
  margin-top: 25px;
}

/* LEFT SIDEBAR */
.logs-sidebar {
  width: 180px;
  font-size: 15px;
  line-height: 1.4;
  flex-shrink: 0;
}

.sidebar-text {
  margin-top: 8px;
  color: #444;
}

/* MIDDLE CONTROLS */
.logs-controls {
  width: 260px;
  background: #fff;
  padding: 18px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.logs-controls label {
  display: block;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 4px;
}

.logs-controls select {
  width: 100%;
  padding: 7px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.logs-controls .btn {
  margin-top: 16px;
  width: 100%;
  padding: 8px 12px;
  background: #244a6f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* RIGHT LOG OUTPUT */
.logs-output {
  flex-grow: 1;
  background: #fff;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  max-height: 85vh;
  overflow-y: auto;
}

.logs-output pre {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.35;
}

/* Optional line-wrapping OFF: use pre instead of pre-wrap */
/* .logs-output pre { white-space: pre; } */

.button-primary {
  background-color: #22466b; /* same as your top nav */
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  margin-top: 12px;
  display: inline-block;
  transition: background 0.2s;
}

.button-primary:hover {
  background-color: #183552;
}

/* Hidden + visible content */
#details-content.details-hidden {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#details-content.details-visible {
  max-height: 800px; /* large enough */
  transition: max-height 0.3s ease;
}

.impersonation-banner {
  width: 100%;
  background: #fff4cc;
  border-bottom: 2px solid #e0b200;
  padding: 12px 18px;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.impersonation-banner .stop-btn {
  background: #cc0000;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.impersonation-banner .stop-btn:hover {
  background: #a30000;
}
.impersonate-btn {
  background: #1e63e9;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
  transition: 0.2s;
}

.impersonate-btn:hover {
  background: #0f49b5;
  color: #fff;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.users-table th,
.users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}

.users-table th {
  background: #f6f8fa;
  font-weight: 600;
}
.alert-flag {
  background: #b73338;
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-left: 8px;
}
.abuse-container {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 16px;
  margin: 20px auto;
  max-width: 1200px;
}
.event-row {
  background: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 12px;
  border-left: 6px solid #d9534f;
}
.event-row.resolved {
  opacity: 0.5;
  border-left-color: #999;
}
.toggle-btn {
  float: right;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: white;
}
.toggle-btn.resolve {
  background: #5cb85c;
}
.toggle-btn.unresolve {
  background: #0275d8;
}

.legacy-box {
  background: black;
  color: #00ff00;
  padding: 20px;
  border-radius: 12px;
  white-space: pre-wrap;
  font-family: monospace;
  margin-top: 30px;
}

.clear-btn {
  margin-top: 10px;
  background: #d9534f;
  padding: 10px 20px;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}
.abuse-row {
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: #fff;
}

.abuse-row.resolved {
  opacity: 0.6;
}

.abuse-meta div {
  margin-bottom: 4px;
}

.resolve-btn {
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: #b73338;
  color: #fff;
  cursor: pointer;
}

.resolve-btn.resolved {
  background: #22527b;
}
.abuse-event {
  background: #fff;
  border: 1px solid #ccc;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 8px;
}

/* Highlight resolved entries */
.abuse-event.resolved {
  background: #e8f8e8; /* light green */
  border-color: #7ac27a;
  opacity: 0.95;
}

/* Title + severity */
.abuse-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* Severity badges */
.badge-low {
  background: #b0daff;
  color: #003e7a;
  padding: 4px 8px;
  border-radius: 5px;
}
.badge-medium {
  background: #ffe0a8;
  color: #7a4b00;
  padding: 4px 8px;
  border-radius: 5px;
}
.badge-high {
  background: #ffb3b3;
  color: #7a0000;
  padding: 4px 8px;
  border-radius: 5px;
}

/* When resolved → tone down severity color */
.abuse-event.resolved .badge-low,
.abuse-event.resolved .badge-medium,
.abuse-event.resolved .badge-high {
  background: #a0cfa0 !important;
  color: #194d19 !important;
}

.resolve-btn {
  padding: 6px 12px;
  background: #204d74;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.resolve-btn.resolved {
  background: #888; /* grey for "Unresolve" */
}
