/* ═══════════════════════════════════════════════════════════
   FLRP Admin Dashboard — Global Styles
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1e2a40;
  --bg-input: #0d1526;
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(99, 179, 237, 0.3);
  --accent: #4f8ef7;
  --accent-hover: #3b7de8;
  --accent-glow: rgba(79, 142, 247, 0.25);
  --success: #48bb78;
  --danger: #fc8181;
  --warning: #f6ad55;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #4a5568;
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overscroll-behavior-y: contain;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overscroll-behavior-y: contain;
}

/* ─── Auth Page ─────────────────────────────────────────────── */
.auth-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  padding: 20px 0;
  overflow-y: auto;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(79, 142, 247, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  z-index: 0;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(79, 142, 247, 0.5));
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.totp-icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: 12px;
}

.totp-desc {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group select option {
  background: var(--bg-secondary);
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  box-shadow: 0 4px 15px rgba(79, 142, 247, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 142, 247, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #38a169, #2f855a);
  color: #fff;
  box-shadow: 0 4px 15px rgba(56, 161, 105, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #d69e2e, #b7791f);
  color: #fff;
}

.btn-warning:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 14px;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
  font-size: 24px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.2), rgba(99, 102, 241, 0.15));
  color: var(--accent);
  border: 1px solid rgba(79, 142, 247, 0.2);
}

.nav-icon {
  font-size: 16px;
}

/* Tutorial highlight */
.tutorial-highlight {
  position: relative;
  z-index: 10001;
  background: rgba(79, 142, 247, 0.15) !important;
  border: 1px solid rgba(79, 142, 247, 0.5) !important;
  box-shadow: 0 0 20px rgba(79, 142, 247, 0.3), inset 0 0 20px rgba(79, 142, 247, 0.05);
  animation: tutorialPulse 2s ease-in-out infinite;
}

@keyframes tutorialPulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(79, 142, 247, 0.3);
  }

  50% {
    box-shadow: 0 0 30px rgba(79, 142, 247, 0.5), 0 0 60px rgba(79, 142, 247, 0.15);
  }
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-logout {
  background: none;
  border: 1px solid rgba(252, 129, 129, 0.3);
  color: var(--danger);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(252, 129, 129, 0.1);
}

/* ─── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-stats {
  display: flex;
  gap: 10px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-chip span {
  color: var(--accent);
  font-weight: 700;
}

/* ─── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

.search-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px 10px 36px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-wrap input:focus {
  border-color: var(--accent);
}

.filter-bar select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

/* ─── Tables ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .loading-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.row-banned td {
  background: rgba(252, 129, 129, 0.04) !important;
}

/* ─── Badges ────────────────────────────────────────────────── */
.job-badge {
  background: rgba(79, 142, 247, 0.15);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.group-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.group-user {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.group-mod {
  background: rgba(72, 187, 120, 0.15);
  color: var(--success);
}

.group-admin,
.group-admin1,
.group-admin2,
.group-admin3,
.group-admin4 {
  background: rgba(246, 173, 85, 0.15);
  color: var(--warning);
}

.group-superadmin {
  background: rgba(252, 129, 129, 0.15);
  color: var(--danger);
}

.group-operator {
  background: rgba(159, 122, 234, 0.15);
  color: #b794f4;
}

.group-admincontroller {
  background: rgba(159, 122, 234, 0.2);
  color: #d6bcfa;
}

.group-developer {
  background: rgba(99, 179, 237, 0.15);
  color: #63b3ed;
}

.group-serverowner {
  background: linear-gradient(135deg, rgba(246, 173, 85, 0.2), rgba(252, 129, 129, 0.2));
  color: #fbd38d;
}

.warn-badge {
  background: rgba(246, 173, 85, 0.15);
  color: var(--warning);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.ban-badge {
  background: rgba(252, 129, 129, 0.15);
  color: var(--danger);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.ok-badge {
  color: var(--success);
}

.no-warn {
  color: var(--text-muted);
}

.money-cell {
  font-family: 'Inter', monospace;
  color: var(--success);
  font-weight: 600;
}

.identifier-cell {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Player Detail ─────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-size: 12px;
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.money-display {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.money-box {
  flex: 1;
  min-width: 120px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.money-box .money-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.money-box .money-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
}

.money-box.bank .money-amount {
  color: var(--accent);
}

.money-box.black .money-amount {
  color: var(--danger);
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s ease;
}

.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ─── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ─── Inventory Grid ────────────────────────────────────────── */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.inv-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.inv-item-count {
  font-size: 11px;
  color: var(--text-muted);
}

.inv-item-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

/* ─── Jobs Page ─────────────────────────────────────────────── */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.job-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 142, 247, 0.15);
}

.job-card-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.job-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.job-card-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.job-card-count-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Misc ──────────────────────────────────────────────────── */
.error-msg {
  background: rgba(252, 129, 129, 0.1);
  border: 1px solid rgba(252, 129, 129, 0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
}

.success-msg {
  background: rgba(72, 187, 120, 0.1);
  border: 1px solid rgba(72, 187, 120, 0.3);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-btn:hover {
  color: var(--text-primary);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  animation: slideUp 0.3s ease;
  max-width: 320px;
}

.toast.success {
  border-color: rgba(72, 187, 120, 0.4);
  color: var(--success);
}

.toast.error {
  border-color: rgba(252, 129, 129, 0.4);
  color: var(--danger);
}

/* ─── Mobile Sidebar ─────────────────────────────────────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
  display: block;
}

@media (max-width: 800px) {
  .hamburger {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 101;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 64px 16px 24px;
  }
}

/* ─── FLRP Logo ──────────────────────────────────────────────── */
.logo-text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #e2e8f0;
  line-height: 1;
}

.logo-rp {
  color: #4f8ef7;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

.logo-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #4a5568;
  display: block;
  margin-top: 2px;
}

/* ─── Mobile card/table improvements ────────────────────────── */
@media (max-width: 800px) {

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .stat-card {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .card-body {
    padding: 16px;
    overflow-x: auto;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-wrap: wrap;
    gap: 4px;
  }

  .tab-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
}