/* ═══════════════════════════════════════════
   Pecado Craft — Panel de Moderación
   ═══════════════════════════════════════════ */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #1c2333;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #ff4757;
  --accent-hover: #ff6b81;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --info: #58a6ff;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  --font-pixel: 'Silkscreen', cursive;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --sidebar-width: 240px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  color: #fff;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); }
.btn-success { background: var(--success); color: #000; }
.btn-warning { background: var(--warning); color: #000; }
.btn-danger  { background: var(--danger); }
.btn-info    { background: var(--info); color: #000; }
.btn-ghost   { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.4rem; font-size: 0.9rem; min-width: 32px; }

/* ── Inputs ────────────────────────────── */
.input-field, .input-group input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.input-field:focus, .input-group input:focus {
  outline: none;
  border-color: var(--accent);
}
.input-group { margin-bottom: 1rem; }
.input-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Login ─────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(-45deg, #0d1117, #1a1a2e, #16213e, #1a0a2e);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  padding: 1rem;
}
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-card {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(48, 54, 61, 0.5);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 60px rgba(255,71,87,0.06);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.nav-icon { display: flex; align-items: center; }
.nav-icon svg { width: 18px; height: 18px; }
.login-logo h1 {
  font-family: var(--font-pixel);
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #ff9a44);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.error-text {
  color: var(--danger);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 0.8rem;
}

/* ── Panel Layout ──────────────────────── */
.panel {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.2rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  font-family: var(--font-pixel);
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #ff9a44);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.2rem;
  color: var(--text-secondary);
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  transition: all var(--transition);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
}
.nav-link.active {
  color: var(--accent);
  background: rgba(255,71,87,0.08);
  border-left-color: var(--accent);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.user-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Content ───────────────────────────── */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1.5rem 2rem;
  min-height: 100vh;
  max-width: 1200px;
}

.tab { display: none; }
.tab.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tab-header h2 { font-family: var(--font-pixel); font-size: 1.3rem; font-weight: 400; letter-spacing: 0.03em; }

/* ── Stats Grid ────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: all var(--transition);
  border-top: 3px solid var(--accent);
}
.stat-card:nth-child(2) { border-top-color: var(--success); }
.stat-card:nth-child(3) { border-top-color: var(--info); }
.stat-card:nth-child(4) { border-top-color: var(--warning); }
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.stat-header {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.stat-value {
  font-family: var(--font-pixel);
  font-size: 1.3rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); animation: dotPulse 2s ease-in-out infinite; }
.status-dot.offline { background: var(--danger); }
.status-dot.connecting { background: var(--warning); animation: dotPulse 1s ease-in-out infinite; }
@keyframes dotPulse { 50% { opacity: 0.4; transform: scale(1.4); } }

.server-badge {
  font-family: var(--font-pixel);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.server-badge.online { background: rgba(63,185,80,0.15); color: var(--success); border: 1px solid rgba(63,185,80,0.3); }
.server-badge.offline { background: rgba(248,81,73,0.15); color: var(--danger); border: 1px solid rgba(248,81,73,0.3); }
.server-badge.connecting { background: rgba(210,153,34,0.15); color: var(--warning); border: 1px solid rgba(210,153,34,0.3); animation: dotPulse 1.5s ease-in-out infinite; }

/* ── Player Grid ───────────────────────── */
.player-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.player-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.player-chip img {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  image-rendering: pixelated;
}

/* ── Console ───────────────────────────── */
.console-output {
  background: #000;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0;
  padding: 0.8rem;
  height: 55vh;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-all;
}
.console-output .log-line { padding: 1px 0; }
.console-output .log-warn { color: var(--warning); }
.console-output .log-error { color: var(--danger); }
.console-output .log-info { color: var(--info); }
.console-output .log-cmd { color: var(--accent); font-weight: bold; }

.console-input {
  display: flex;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.console-input input {
  flex: 1;
  padding: 0.7rem;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.console-input input:focus { outline: none; }
.console-input button { border-radius: 0; }

/* ── Panel Section ─────────────────────── */
.panel-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
}
.panel-section h3 {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quick-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.action-card {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  white-space: nowrap;
}
.action-card:hover,
.action-card:focus-visible {
  text-decoration: none;
}
.action-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.action-card__icon svg {
  width: 16px;
  height: 16px;
}
.action-card__label {
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1;
}
.action-card__desc {
  display: none;
}

/* Warning variant — Broadcast */
.action-card--warning {
  color: var(--warning);
  background: rgba(210,153,34,0.08);
}
.action-card--warning:hover {
  background: rgba(210,153,34,0.18);
}
.action-card--warning .action-card__icon {
  background: rgba(210,153,34,0.15);
  color: var(--warning);
}

/* Danger variant — Reiniciar */
.action-card--danger {
  color: var(--danger);
  background: rgba(248,81,73,0.08);
}
.action-card--danger:hover {
  background: rgba(248,81,73,0.18);
}
.action-card--danger .action-card__icon {
  background: rgba(248,81,73,0.15);
  color: var(--danger);
}

/* Info variant — Mapa */
.action-card--info {
  color: var(--info);
  background: rgba(88,166,255,0.08);
}
.action-card--info:hover {
  background: rgba(88,166,255,0.18);
}
.action-card--info .action-card__icon {
  background: rgba(88,166,255,0.15);
  color: var(--info);
}

/* ── Data Table ────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.data-table td { font-size: 0.9rem; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table .player-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.data-table .player-cell img {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  image-rendering: pixelated;
}
.data-table .action-cell {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

/* ── Control Grid ──────────────────────── */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.control-card h3 {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.form-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.form-row .input-field { flex: 1; min-width: 140px; }



/* ── Toast ─────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  max-width: 350px;
  word-break: break-word;
}
.toast.success { background: var(--success); color: #000; }
.toast.error   { background: var(--danger); color: #fff; }
.toast.info    { background: var(--info); color: #000; }
.toast.warning { background: var(--warning); color: #000; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(50%); } }

/* ── Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 1rem;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.modal h3 { font-family: var(--font-pixel); margin-bottom: 1rem; font-size: 1rem; }
.modal-body { margin-bottom: 1rem; }
.modal-body input {
  width: 100%;
  padding: 0.6rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}
.modal-body input:focus { outline: none; border-color: var(--accent); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ── Utility ───────────────────────────── */
.text-muted { color: var(--text-secondary); font-size: 0.85rem; }

/* ── Role Badges ────────────────────── */
.role-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.role-mod { background: rgba(88,166,255,0.15); color: var(--info); border: 1px solid rgba(88,166,255,0.3); }
.role-admin { background: rgba(210,153,34,0.15); color: var(--warning); border: 1px solid rgba(210,153,34,0.3); }
.role-superadmin { background: rgba(255,71,87,0.15); color: var(--accent); border: 1px solid rgba(255,71,87,0.3); }
.user-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.tps-good { color: var(--success); }
.tps-ok { color: var(--warning); }
.tps-bad { color: var(--danger); }

/* ── Memory bar ────────────────────────── */
.memory-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.memory-bar {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.5s ease, background 0.5s ease;
}
.memory-bar.mem-mid { background: var(--warning); }
.memory-bar.mem-high { background: var(--danger); }

/* ── Player count badge ────────────────── */
.player-count-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  min-width: 1.4rem;
  text-align: center;
}
.text-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }

/* ── Player detail panel ───────────────── */
.player-detail-panel {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.player-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.player-detail-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.player-detail-identity h3 { margin: 0; font-size: 1.1rem; }
.detail-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  image-rendering: pixelated;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
}
.detail-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
}
.detail-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.detail-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.detail-subtitle {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}
.detail-item.health .detail-value { color: var(--danger); }
.detail-item.hunger .detail-value { color: var(--warning); }
.detail-item.afk-yes .detail-value { color: var(--text-secondary); }

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Logo ──────────────────────────────── */
.login-logo-img {
  width: 160px;
  height: auto;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(255,71,87,0.3));
}
.sidebar-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: contain;
}

/* ── Responsive ────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: block;
    position: fixed;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 150;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
  }
  .content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 3.5rem;
  }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .control-grid { grid-template-columns: 1fr; }
  .console-output { height: 40vh; }
  .audit-filters { flex-direction: column; }
  .audit-details { max-width: 200px; }
}

/* ── Audit & Sessions ──────────────────── */
.audit-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.audit-filters .input-field,
.audit-filters select {
  flex: 1;
  min-width: 150px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.audit-filters select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}
.audit-filters select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.audit-filters .input-field:focus,
.audit-filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.audit-details {
  max-width: 350px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  word-break: break-word;
}
.audit-details code {
  background: var(--bg-primary);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem 0;
}

.tab-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ── Badges ────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-auth { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.badge-cmd { background: rgba(210, 153, 34, 0.15); color: #d29922; }
.badge-mod { background: rgba(255, 71, 87, 0.15); color: #ff4757; }
.badge-world { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.badge-users { background: rgba(188, 140, 255, 0.15); color: #bc8cff; }
.badge-system { background: rgba(139, 148, 158, 0.15); color: #8b949e; }

.badge-action-success { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.badge-action-danger { background: rgba(248, 81, 73, 0.15); color: #f85149; }
.badge-action-warning { background: rgba(210, 153, 34, 0.15); color: #d29922; }
.badge-action-info { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }

/* ── Server Config ─────────────────────── */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.config-card-wide {
  grid-column: 1 / -1;
}
.config-field {
  margin-bottom: 0.8rem;
}
.config-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.config-help {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}
.config-help a {
  color: var(--info);
}
.config-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
}
.config-actions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.config-warning {
  font-size: 0.8rem;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.config-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.config-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.config-toggle:last-child {
  border-bottom: none;
}
.config-toggle label:first-child {
  font-size: 0.85rem;
  color: var(--text-primary);
}
.motd-preview {
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: #000;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1rem;
  min-height: 1.8rem;
  letter-spacing: 0.02em;
}

/* ── Toggle Switch ─────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 22px;
  transition: all var(--transition);
}
.slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition);
}
.switch input:checked + .slider {
  background: rgba(63,185,80,0.2);
  border-color: var(--success);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: var(--success);
}

/* ── Restart Schedule ──────────────────── */
.schedule-times-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.schedule-time-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.schedule-time-value {
  color: var(--info);
  font-weight: 600;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
  cursor: pointer;
}
.watchdog-status {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.watchdog-status .form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Plugins ───────────────────────────── */
.plugins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.plugin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color var(--transition);
}
.plugin-card:hover {
  border-color: var(--accent);
}
.plugin-card.disabled {
  opacity: 0.55;
}
.plugin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.plugin-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  word-break: break-word;
}
.plugin-card-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.plugin-card-status.active {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
}
.plugin-card-status.inactive {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
}
.plugin-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ── Console Search ──────────────────────── */
.console-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.console-search input {
  flex: 1;
  padding: 0.3rem 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.console-search input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Backup Cards ───────────────────────── */
.backup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: border-color var(--transition);
}
.backup-card:hover {
  border-color: var(--accent);
}
.backup-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.backup-name {
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.backup-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.backup-actions {
  display: flex;
  gap: 0.4rem;
}

/* ── Analytics Charts ───────────────────── */
.analytics-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1rem;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.chart-card h3 {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.chart-card-wide {
  grid-column: 1 / -1;
}
.chart-container {
  width: 100%;
  min-height: 100px;
  overflow: hidden;
}
.chart-legend {
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  margin-left: 0.3rem;
}

/* ── Health Banner ─────────────────────── */
.health-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border-left: 4px solid var(--text-secondary);
  transition: all var(--transition);
}
.health-banner.health-good { border-left-color: var(--success); }
.health-banner.health-ok { border-left-color: var(--warning); }
.health-banner.health-warn { border-left-color: #ff9a44; }
.health-banner.health-bad { border-left-color: var(--danger); }

.health-score-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 3px solid var(--border);
  transition: border-color var(--transition);
}
.health-good .health-score-ring { border-color: var(--success); }
.health-ok .health-score-ring { border-color: var(--warning); }
.health-warn .health-score-ring { border-color: #ff9a44; }
.health-bad .health-score-ring { border-color: var(--danger); }

.health-score-value {
  font-family: var(--font-pixel);
  font-size: 1.3rem;
  font-weight: 700;
}
.health-good .health-score-value { color: var(--success); }
.health-ok .health-score-value { color: var(--warning); }
.health-warn .health-score-value { color: #ff9a44; }
.health-bad .health-score-value { color: var(--danger); }

.health-info {
  flex: 1;
}
.health-info h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.health-good .health-info h3 { color: var(--success); }
.health-ok .health-info h3 { color: var(--warning); }
.health-warn .health-info h3 { color: #ff9a44; }
.health-bad .health-info h3 { color: var(--danger); }

.health-quick-stats {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.health-qs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.health-qs-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.health-qs-val {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ── Incidents ─────────────────────────── */
.incident-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  border-left: 3px solid transparent;
}
.incident-row.incident-critical {
  background: rgba(248, 81, 73, 0.06);
  border-left-color: var(--danger);
}
.incident-row.incident-warning {
  background: rgba(210, 153, 34, 0.06);
  border-left-color: var(--warning);
}
.incident-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.incident-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.incident-msg {
  flex: 1;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .analytics-charts { grid-template-columns: 1fr; }
  .backup-card { flex-direction: column; gap: 0.8rem; align-items: flex-start; }
  .health-banner { flex-direction: column; text-align: center; }
  .health-quick-stats { justify-content: center; }
}

/* ── Battle Pass ─────────────────────── */
.bp-status-banner {
  background: linear-gradient(135deg, rgba(210,153,34,0.08), rgba(56,139,253,0.06));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
}
.bp-status-info h3 {
  font-family: var(--font-pixel);
  color: var(--warning);
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.bp-status-stats {
  display: flex;
  gap: 1.5rem;
  margin: 0.8rem 0;
  flex-wrap: wrap;
}
.bp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bp-stat-value {
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}
.bp-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.bp-season-progress {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
}
.bp-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.bp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning), var(--accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* BP Sub-tabs */
.bp-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}
.bp-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.bp-tab:hover { color: var(--text-primary); }
.bp-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.bp-panel { margin-top: 0.5rem; }

.bp-section {
  margin-bottom: 1.5rem;
}
.bp-section h3 {
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}
.bp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.bp-section-header h3 { margin-bottom: 0; }

/* Mission Cards */
.bp-missions-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.bp-mission-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.bp-mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.bp-mission-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.bp-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.bp-field label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.bp-field .input-field {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
}

/* Reward Cards */
.bp-rewards-track {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.bp-reward-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.bp-reward-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.bp-reward-level {
  font-family: var(--font-pixel);
  color: var(--warning);
  font-weight: 700;
}
.bp-reward-tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.bp-reward-free, .bp-reward-premium {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.bp-track-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.bp-reward-free .bp-track-label { color: var(--success); }
.bp-reward-premium .bp-track-label { color: var(--warning); }
.bp-reward-free .input-field,
.bp-reward-premium .input-field {
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
}

/* Premium badge */
.badge-premium {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-online {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.badge-offline {
  background: rgba(139, 148, 158, 0.15);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .bp-status-stats { gap: 1rem; }
  .bp-reward-tracks { grid-template-columns: 1fr; }
  .bp-mission-fields { grid-template-columns: 1fr 1fr; }
}
