/* ═══════════════════════════════════════════
   admin.css — Verfall Admin Panel
   Used by: admin.html (extends style.css tokens)
═══════════════════════════════════════════ */

:root { --mid: #1a1510; } /* present in shared.css's tokens, missing from style.css */

html, body { overflow: auto; }

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 12, 9, 0.96);
  border: 1px solid rgba(184, 146, 42, 0.3);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--bone);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease both;
  pointer-events: auto;
}

.toast.toast-success { border-left-color: #5a9a5c; }
.toast.toast-error { border-left-color: var(--rust); }

.toast.toast-leaving {
  animation: toastOut 0.25s ease both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

.stage {
  display: block;
  position: relative;
  z-index: 2;
  height: auto;
  min-height: 100%;
  padding: 110px 28px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Admin-only: enlarge the topbar (~40%) so the nav buttons read more easily.
   Scoped to body#admin so it never affects the homepage/ToS/verify pages,
   which share style.css's base .topbar rule. */
body#admin .topbar {
  height: 78px;
}

body#admin .topbar-name {
  font-size: 21px;
}

body#admin #topbar-status {
  font-size: 13px;
  padding: 10px 22px;
}

.view { display: none; }
.view.active { display: block; animation: fadeUp 0.3s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#view-loading, #view-denied {
  text-align: center;
  margin-top: 80px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

#view-login.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 150px); /* offsets .stage's 110px top + 40px bottom padding */
}

#view-login .card {
  text-align: center;
}

#view-login .btn-stack {
  align-items: center;
  margin-top: 22px;
}

#view-login .btn {
  width: auto;
  padding: 12px 26px;
}

.admin-nav {
  display: flex;
  gap: 10px;
}

.admin-nav button,
.admin-form button,
.toolbar button,
#run-inactivity-btn,
#restart-bot-btn {
  background: var(--mid);
  color: var(--bone);
  border: 1px solid rgba(184, 146, 42, 0.3);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: inherit;
  cursor: pointer;
}

/* Admin-only: nav buttons get a larger size (~40%) than the shared button
   styles above, to match the enlarged topbar. Scoped to body#admin. */
body#admin .admin-nav button {
  padding: 9px 20px;
  font-size: 16px;
  border-radius: 5px;
}

.admin-nav button:hover,
.admin-form button:hover,
.toolbar button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Whichever tab is currently open gets a subtle highlight so it's clear
   where you are. */
.admin-nav button.active {
  background: rgba(184, 146, 42, 0.16);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: inset 0 -2px 0 0 var(--gold);
}

.admin-nav button.nav-commands.active {
  background: rgba(232, 133, 43, 0.16);
  border-color: #e8852b;
  color: #f4a155;
  box-shadow: inset 0 -2px 0 0 #e8852b, 0 0 16px rgba(232, 133, 43, 0.4);
}

#restart-bot-btn {
  border-color: var(--rust);
  color: var(--rust);
}

#restart-bot-btn:hover {
  background: var(--rust);
  color: var(--bone);
}

.toolbar, .admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ash);
  cursor: pointer;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--dim);
}

.toolbar-group:first-child {
  padding-left: 0;
  border-left: none;
}

.toolbar-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.toolbar input,
.toolbar select,
.admin-form input,
.admin-form select {
  background: var(--dark);
  color: var(--bone);
  border: 1px solid var(--dim);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: inherit;
}

.toolbar select,
.admin-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 28px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.toolbar select:hover,
.admin-form select:hover,
.toolbar select:focus,
.admin-form select:focus {
  border-color: var(--gold);
  outline: none;
}

.toolbar select option,
.admin-form select option {
  background: var(--dark);
  color: var(--bone);
}

.perm-group-card {
  background: linear-gradient(160deg, rgba(22, 17, 13, 0.7), rgba(10, 8, 6, 0.55));
  border: 1px solid rgba(184, 146, 42, 0.22);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.perm-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(184, 146, 42, 0.15);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.perm-group-header strong {
  font-family: 'Cinzel Decorative', serif;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--bone);
}

.chip-remove-group {
  background: none;
  border: 1px solid rgba(139, 58, 42, 0.4);
  color: #c47a6a;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-remove-group:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--bone);
}

.perm-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.perm-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.perm-row > label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ash);
  cursor: pointer;
  min-width: 90px;
}

.perm-subchecks {
  display: flex;
  gap: 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(184, 146, 42, 0.2);
}

.perm-subchecks label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ash);
  opacity: 0.85;
  cursor: pointer;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  background: var(--dark);
  border: 1px solid rgba(184, 146, 42, 0.4);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

input[type="checkbox"]:hover:not(:disabled) {
  border-color: var(--gold);
}

input[type="checkbox"]:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid var(--dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

input[type="checkbox"]:disabled:checked {
  background: var(--dim);
  border-color: var(--dim);
}

input[type="checkbox"]:disabled:checked::after {
  border-color: var(--ash);
}

.role-editor {
  background: linear-gradient(160deg, rgba(22, 17, 13, 0.7), rgba(10, 8, 6, 0.55));
  border: 1px solid rgba(184, 146, 42, 0.22);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.role-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(184, 146, 42, 0.15);
  padding-bottom: 14px;
}

.role-editor .toolbar {
  margin: 0;
}

.role-editor label {
  font-family: 'Cinzel Decorative', serif;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
}

.role-count {
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  opacity: 0.7;
}

.role-chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  min-height: 40px;
}

.role-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 21, 16, 0.9);
  border: 1px solid rgba(184, 146, 42, 0.32);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.02em;
  color: var(--bone);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, transform 0.2s ease;
  animation: fadeUp 0.25s ease both;
}

.role-chip:hover {
  border-color: rgba(184, 146, 42, 0.6);
  transform: translateY(-1px);
}

.role-chip-empty {
  list-style: none;
  font-style: italic;
  font-size: 13px;
  color: var(--ash);
  opacity: 0.55;
  padding: 8px 2px;
}

.chip-remove {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: var(--ash);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chip-remove:hover {
  background: var(--rust);
  color: var(--bone);
  transform: scale(1.08);
}

.role-add-form {
  margin: 4px 0 0;
}

.role-add-form input {
  flex: 1;
  min-width: 180px;
}

.role-add-form button {
  background: linear-gradient(135deg, var(--rust) 0%, var(--blood) 100%);
  color: var(--bone);
  border: 1px solid rgba(139, 58, 42, 0.5);
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 4px;
  transition: all 0.25s ease;
}

.role-add-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(92, 26, 14, 0.4);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--dim);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--gold);
  font-weight: 600;
}

.admin-table button {
  background: none;
  border: 1px solid var(--dim);
  color: var(--ash);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  margin-right: 4px;
}

.admin-table button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.config-view {
  background: var(--dark);
  border: 1px solid var(--dim);
  border-radius: 4px;
  padding: 12px;
  max-height: 320px;
  overflow: auto;
  font-size: 13px;
  white-space: pre-wrap;
}

/* ── Commands tab ── */
.restart-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(160deg, rgba(92, 26, 14, 0.35), rgba(20, 10, 5, 0.4));
  border: 1px solid rgba(139, 58, 42, 0.45);
  border-left: 3px solid var(--rust);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--bone);
  animation: fadeUp 0.3s ease both;
}

.restart-banner button {
  background: rgba(196, 122, 106, 0.12);
  color: #e0a99c;
  border: 1px solid rgba(196, 122, 106, 0.4);
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.restart-banner button:hover {
  background: rgba(139, 58, 42, 0.3);
  border-color: rgba(196, 122, 106, 0.6);
  color: var(--bone);
  transform: translateY(-1px);
}

.restart-note {
  font-style: italic;
  color: var(--ash);
  opacity: 0.8;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: linear-gradient(160deg, rgba(22, 17, 13, 0.7), rgba(10, 8, 6, 0.55));
  border: 1px solid rgba(184, 146, 42, 0.22);
  border-radius: 10px;
  padding: 18px 20px;
  cursor: pointer;
  font-family: inherit;
  color: var(--bone);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.server-card:hover {
  border-color: rgba(184, 146, 42, 0.6);
  transform: translateY(-2px);
}

.server-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(184, 146, 42, 0.4), 0 6px 24px rgba(0, 0, 0, 0.35);
}

.server-icon {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--dark);
  border: 1px solid rgba(184, 146, 42, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Cinzel Decorative', serif;
  font-size: 24px;
  color: var(--gold);
}

.server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.server-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel Decorative', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.9;
}

.server-detail {
  background: linear-gradient(160deg, rgba(22, 17, 13, 0.7), rgba(10, 8, 6, 0.55));
  border: 1px solid rgba(184, 146, 42, 0.22);
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.3s ease both;
}

.server-detail-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(184, 146, 42, 0.15);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.server-detail-header strong {
  font-family: 'Cinzel Decorative', serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--bone);
}

.server-detail-id {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--ash);
  opacity: 0.7;
}

.command-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.command-search {
  flex: 1;
  min-width: 200px;
  box-sizing: border-box;
  background: var(--dark);
  color: var(--bone);
  border: 1px solid var(--dim);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: inherit;
}

.command-search:focus {
  border-color: var(--gold);
  outline: none;
}

.command-category-select {
  box-sizing: border-box;
  background: var(--dark);
  color: var(--bone);
  border: 1px solid var(--dim);
  border-radius: 4px;
  padding: 8px 28px 8px 12px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.command-category-select:hover,
.command-category-select:focus {
  border-color: var(--gold);
  outline: none;
}

.command-category-select option {
  background: var(--dark);
  color: var(--bone);
}

.command-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.command-pick {
  position: relative;
  background: rgba(20, 16, 12, 0.88);
  border: 1px solid rgba(184, 146, 42, 0.16);
  border-radius: 8px;
  padding: 13px 15px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.command-pick.clickable {
  cursor: pointer;
}

.command-pick.clickable:hover {
  border-color: rgba(184, 146, 42, 0.4);
  background: rgba(34, 27, 19, 0.92);
}

.command-pick.assigned {
  border-color: rgba(184, 146, 42, 0.6);
  background: rgba(30, 24, 17, 0.92);
  box-shadow: inset 3px 0 0 0 var(--gold), 0 2px 12px rgba(0, 0, 0, 0.3);
}

.command-pick.busy {
  opacity: 0.55;
  pointer-events: none;
}

.command-pick.flash {
  animation: commandFlash 0.65s ease;
}

@keyframes commandFlash {
  0% { box-shadow: inset 3px 0 0 0 var(--gold), 0 0 16px rgba(184, 146, 42, 0.55); }
  100% { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
}

.command-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.command-name {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--bone);
}

.command-status {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(40, 36, 30, 0.55);
  color: var(--bone);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Hover hint on the "+ Add" pill follows the whole-card hover */
.command-pick.clickable:hover .command-status:not(.added) {
  background: rgba(184, 146, 42, 0.14);
  border-color: rgba(184, 146, 42, 0.5);
  color: var(--gold);
}

.command-status.added {
  background: rgba(184, 146, 42, 0.18);
  border-color: rgba(184, 146, 42, 0.6);
  color: var(--gold);
}

.command-status.global {
  background: rgba(120, 137, 218, 0.08);
  border-color: rgba(120, 137, 218, 0.4);
  color: #8d9bd6;
  opacity: 0.85;
}

.command-info {
  margin-top: 8px;
}

.command-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.command-badge {
  font-family: 'Cinzel Decorative', serif;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(184, 146, 42, 0.3);
  color: var(--gold);
  opacity: 0.85;
}

.command-badge.dev {
  border-color: rgba(139, 58, 42, 0.5);
  color: #c47a6a;
}

.command-badge.global {
  border-color: rgba(120, 137, 218, 0.4);
  color: #8d9bd6;
}

.command-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--bone);
  opacity: 0.82;
  margin: 0;
}

/* ── Access panel embiggening (~40%) ──
   #view-access's higher specificity overrides the shared rules above,
   regardless of source order, so this section can live on its own. */
#view-access h2 {
  font-size: clamp(28px, 5.5vw, 39px);
}

#view-access .desc {
  font-size: 20px;
  max-width: none;
}

#view-access .admin-form input,
#view-access .admin-form select {
  padding: 9px 14px;
  font-size: 16px;
}

#view-access .admin-form button {
  padding: 9px 20px;
  font-size: 15px;
}

#view-access .perm-group-card {
  padding: 25px 28px;
  margin-bottom: 25px;
}

#view-access .perm-group-header {
  padding-bottom: 17px;
  margin-bottom: 20px;
}

#view-access .perm-group-header strong {
  font-size: 18px;
}

#view-access .chip-remove-group {
  padding: 6px 14px;
  font-size: 15px;
}

#view-access .perm-checkboxes {
  gap: 14px;
}

#view-access .perm-row {
  gap: 22px;
}

#view-access .perm-row > label {
  font-size: 18px;
  gap: 8px;
  min-width: 126px;
}

#view-access .perm-subchecks {
  gap: 20px;
  padding-left: 17px;
}

#view-access .perm-subchecks label {
  font-size: 17px;
  gap: 7px;
}

#view-access .role-chip-list {
  gap: 14px;
  margin: 25px 0;
  min-height: 56px;
}

#view-access .role-chip {
  gap: 11px;
  padding: 8px 8px 8px 22px;
  font-size: 18px;
}

#view-access .role-chip-empty {
  font-size: 18px;
}

#view-access .chip-remove {
  width: 30px;
  height: 30px;
  font-size: 21px;
}

#view-access .role-add-form button {
  font-size: 13px;
  padding: 12px 24px;
}

#view-access input[type="checkbox"] {
  width: 21px;
  height: 21px;
}

#view-access input[type="checkbox"]:checked::after {
  left: 6px;
  top: 1px;
  width: 6px;
  height: 11px;
}

/* Commands nav button — set apart with a warm orange glow */
.admin-nav button.nav-commands {
  border-color: rgba(232, 133, 43, 0.55);
  color: #e8852b;
  box-shadow: 0 0 10px rgba(232, 133, 43, 0.25);
  animation: navCommandsGlow 2.8s ease-in-out infinite;
}

.admin-nav button.nav-commands:hover {
  border-color: #e8852b;
  color: #f4a155;
  box-shadow: 0 0 16px rgba(232, 133, 43, 0.5);
}

@keyframes navCommandsGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(232, 133, 43, 0.22); }
  50% { box-shadow: 0 0 15px rgba(232, 133, 43, 0.45); }
}

/* ── Damage logs tab ── */
.damagelogs-stats {
  background: linear-gradient(160deg, rgba(22, 17, 13, 0.7), rgba(10, 8, 6, 0.55));
  border: 1px solid rgba(184, 146, 42, 0.22);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.damagelogs-stats-text {
  font-size: 18px;
  color: var(--bone);
  margin-bottom: 12px;
}

.damagelogs-stats-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--dark);
  border: 1px solid var(--dim);
  overflow: hidden;
}

.damagelogs-stats-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #e8852b);
  transition: width 0.3s ease;
}

.damagelogs-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.damagelogs-mode-toggle button {
  background: var(--mid);
  color: var(--ash);
  border: 1px solid var(--dim);
  border-radius: 4px;
  padding: 6px 16px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.damagelogs-mode-toggle button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.damagelogs-mode-toggle button.active {
  background: rgba(184, 146, 42, 0.16);
  border-color: var(--gold);
  color: var(--gold);
}

.damagelogs-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 14px;
}

.damagelogs-dropzone {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 24px 18px;
  border: 2px dashed rgba(184, 146, 42, 0.35);
  border-radius: 10px;
  background: rgba(20, 16, 12, 0.5);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.damagelogs-dropzone input[type="file"] {
  display: none;
}

.damagelogs-dropzone:hover {
  border-color: rgba(184, 146, 42, 0.6);
  background: rgba(30, 24, 17, 0.6);
}

.damagelogs-dropzone.dragover {
  border-color: var(--gold);
  border-style: solid;
  background: rgba(184, 146, 42, 0.12);
  box-shadow: 0 0 18px rgba(184, 146, 42, 0.25);
}

.damagelogs-dropzone-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.damagelogs-dropzone-sub {
  font-size: 12px;
  color: var(--ash);
  opacity: 0.7;
}

.damagelogs-upload-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
}

.damagelogs-upload-status {
  font-size: 12px;
  font-style: italic;
  color: var(--ash);
  opacity: 0.8;
}

#dl-clear-upload-btn {
  background: rgba(196, 122, 106, 0.12);
  color: #c47a6a;
  border: 1px solid rgba(196, 122, 106, 0.4);
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#dl-clear-upload-btn:hover {
  background: rgba(139, 58, 42, 0.3);
  border-color: rgba(196, 122, 106, 0.6);
  color: var(--bone);
}

.damagelogs-pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.damagelogs-pagination button {
  background: var(--mid);
  color: var(--bone);
  border: 1px solid rgba(184, 146, 42, 0.3);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: inherit;
  cursor: pointer;
}

.damagelogs-pagination button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.damagelogs-pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

.damagelogs-pagination span {
  font-size: 12px;
  color: var(--ash);
  opacity: 0.8;
}

/* ── Home landing panel ── */
.home-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  background: linear-gradient(160deg, rgba(22, 17, 13, 0.7), rgba(10, 8, 6, 0.55));
  border: 1px solid rgba(184, 146, 42, 0.22);
  border-radius: 10px;
  padding: 18px 20px;
  cursor: pointer;
  font-family: inherit;
  color: var(--bone);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.home-card:hover {
  border-color: rgba(184, 146, 42, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.home-card-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.home-card-desc {
  font-size: 13px;
  color: var(--ash);
  opacity: 0.85;
  line-height: 1.5;
}

.home-card-commands {
  border-color: rgba(232, 133, 43, 0.35);
}

.home-card-commands .home-card-title {
  color: #e8852b;
}

.home-card-commands:hover {
  border-color: #e8852b;
  box-shadow: 0 0 18px rgba(232, 133, 43, 0.25), 0 6px 28px rgba(0, 0, 0, 0.35);
}

/* ── Account menu (click the admin name pill top right) ── */
.topbar-account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.topbar-rank {
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
  white-space: nowrap;
  cursor: default;
}

.topbar-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(15, 12, 9, 0.97);
  border: 1px solid rgba(184, 146, 42, 0.3);
  border-radius: 6px;
  padding: 8px;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 60;
}

.topbar-account.open .topbar-account-menu {
  display: block;
  animation: fadeUp 0.2s ease both;
}

.topbar-account-menu button {
  width: 100%;
  background: rgba(196, 122, 106, 0.12);
  color: #c47a6a;
  border: 1px solid rgba(196, 122, 106, 0.4);
  border-radius: 4px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.topbar-account-menu button:hover {
  background: rgba(139, 58, 42, 0.3);
  border-color: rgba(196, 122, 106, 0.6);
  color: var(--bone);
}

/* ── Control tab ── */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.control-card {
  background: linear-gradient(160deg, rgba(22, 17, 13, 0.7), rgba(10, 8, 6, 0.55));
  border: 1px solid rgba(184, 146, 42, 0.22);
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.control-card h3 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 14px;
}

.control-card-danger {
  border-color: rgba(139, 58, 42, 0.35);
}

.control-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.control-status-badge {
  display: inline-flex;
  align-self: flex-start;
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.control-status-badge.is-online {
  background: rgba(90, 154, 92, 0.15);
  border: 1px solid rgba(90, 154, 92, 0.5);
  color: #5a9a5c;
}

.control-status-badge.is-offline {
  background: rgba(139, 58, 42, 0.15);
  border: 1px solid rgba(196, 122, 106, 0.5);
  color: #c47a6a;
}

.control-stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(184, 146, 42, 0.1);
  font-size: 13px;
}

.control-stat-row:last-child {
  border-bottom: none;
}

.control-stat-label {
  color: var(--ash);
  opacity: 0.85;
}

.control-stat-value {
  color: var(--bone);
  font-family: 'Courier New', monospace;
  text-align: right;
}

.pm2-process {
  background: rgba(10, 8, 6, 0.4);
  border: 1px solid var(--dim);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.pm2-process:last-child {
  margin-bottom: 0;
}

.pm2-process.is-bot {
  border-color: rgba(184, 146, 42, 0.4);
}

.pm2-process-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pm2-process-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--bone);
}

.pm2-process-status {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--dim);
  color: var(--ash);
}

.pm2-process-status.status-online {
  border-color: rgba(90, 154, 92, 0.5);
  color: #5a9a5c;
}

.pm2-process-status.status-stopped,
.pm2-process-status.status-errored {
  border-color: rgba(196, 122, 106, 0.5);
  color: #c47a6a;
}

.pm2-process-rows {
  display: flex;
  flex-direction: column;
}

/* ── Confirmation modal (replaces window.confirm) ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 4, 3, 0.7);
  backdrop-filter: blur(4px);
  padding: 20px;
}

.confirm-overlay.open {
  display: flex;
  animation: fadeUp 0.2s ease both;
}

.confirm-modal {
  position: relative;
  width: min(380px, 100%);
  background: rgba(12, 10, 8, 0.96);
  border: 1px solid rgba(184, 146, 42, 0.3);
  border-radius: 4px;
  padding: 28px 26px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

#confirm-message {
  color: var(--bone);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#confirm-cancel-btn {
  background: var(--mid);
  color: var(--ash);
  border: 1px solid var(--dim);
  border-radius: 4px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

#confirm-cancel-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

#confirm-ok-btn {
  background: linear-gradient(135deg, var(--rust) 0%, var(--blood) 100%);
  color: var(--bone);
  border: 1px solid rgba(139, 58, 42, 0.5);
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
}

#confirm-ok-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(92, 26, 14, 0.4);
}
