/* ===== Beyond Dark Theme ===== */
:root {
  --bg: #0e0e14;
  --bg-surface: #15151e;
  --bg-card: #1c1c28;
  --bg-card-hover: #22222f;
  --bg-elevated: #262635;
  --accent: #5999ff;
  --accent-hover: #78adff;
  --accent-dim: rgba(89, 153, 255, 0.12);
  --accent-secondary: #73cca6;
  --accent-secondary-dim: rgba(115, 204, 166, 0.12);
  --warning: #f5a623;
  --warning-dim: rgba(245, 166, 35, 0.12);
  --danger: #ff5a5a;
  --danger-dim: rgba(255, 90, 90, 0.12);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.35);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 150ms ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

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

/* ===== Top Bar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.topbar-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
  background: var(--accent-secondary);
  color: #0e0e14;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Form Elements ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

input[type="number"] {
  color-scheme: dark;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ===== Toggle ===== */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: all var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== Chips ===== */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  user-select: none;
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip:hover:not(.active) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.chip .chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  background: rgba(255,255,255,0.2);
  margin-left: 2px;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* ===== Section ===== */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===== Login Page ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: block;
  box-shadow: 0 0 24px rgba(89, 153, 255, 0.3), 0 4px 16px rgba(0,0,0,0.4);
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form .btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
  margin-top: 8px;
}

.login-error {
  padding: 10px 14px;
  background: var(--danger-dim);
  border: 1px solid rgba(255, 90, 90, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  display: none;
}

.login-error.visible { display: block; }

/* ===== Page Container ===== */
.page {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  width: 16px;
  height: 16px;
}

.search-input {
  padding: 10px 14px 10px 38px;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-tertiary); }

/* ===== Filter Chips Row ===== */
.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ===== Items Grid ===== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.item-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.item-card-image {
  width: 100%;
  height: 160px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.item-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.item-card-image .no-image {
  color: var(--text-tertiary);
  font-size: 32px;
}

.item-card-body {
  padding: 16px;
}

.item-card-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.item-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-weapon {
  background: var(--warning-dim);
  color: var(--warning);
}

.badge-vehicle {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-item {
  background: var(--accent-secondary-dim);
  color: var(--accent-secondary);
}

.badge-featured {
  background: var(--warning-dim);
  color: var(--warning);
}

.badge-tag {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.item-card-price {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-secondary);
}

.item-card-price svg {
  width: 14px;
  height: 14px;
}

/* ===== Editor Page ===== */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

.editor-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 80px;
  overflow: hidden;
}

.editor-sidebar .card {
  overflow: hidden;
}

.stat-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Image Upload ===== */
.image-upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-tertiary);
}

.image-upload-zone:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.image-upload-zone svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
}

.image-upload-zone p {
  font-size: 13px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.image-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  aspect-ratio: 1;
  max-height: 150px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-preview .image-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0,0,0,0.7);
  color: #fff;
  text-transform: uppercase;
}

.image-preview .image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 90, 90, 0.8);
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.image-preview:hover .image-remove { opacity: 1; }

/* ===== Sidebar Info ===== */
.sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.sidebar-info-row .label {
  color: var(--text-tertiary);
}

.sidebar-info-row .value {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Editor Actions ===== */
.editor-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-actions .btn {
  width: 100%;
  min-height: 44px;
  height: auto;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toastIn 300ms ease;
  min-width: 280px;
}

.toast-success {
  background: var(--accent-secondary);
  color: #0e0e14;
}

.toast-error {
  background: var(--danger);
  color: #fff;
  max-width: 420px;
  line-height: 1.5;
  font-weight: 400;
}

.toast-info {
  background: var(--accent);
  color: #fff;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Loading Spinner ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 14px;
}

/* ===== Confirm Dialog ===== */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 150ms ease;
}

.dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}

.dialog h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dialog p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Back Link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 16px;
  transition: color var(--transition);
}

.back-link:hover { color: var(--accent); }

.back-link svg {
  width: 16px;
  height: 16px;
}

/* ===== Custom Key-Value pairs ===== */
.kv-row {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  gap: 8px;
  align-items: end;
}

.kv-row .btn-icon {
  width: 36px;
  height: 38px;
}

/* ===== Sidebar ===== */
#app {
  flex-direction: row;
}

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: rgba(21, 21, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.sidebar-brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  overflow-y: auto;
}

.sidebar-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  padding: 20px 12px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-logout {
  color: var(--text-tertiary) !important;
}

.sidebar-logout:hover {
  color: var(--danger) !important;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
}

.main-content .page {
  max-width: 1400px;
  padding: 32px;
}

/* ===== Dashboard ===== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 24px;
  row-gap: 0;
  align-items: start;
}

.dashboard-sidebar {
  position: sticky;
  top: 32px;
  grid-column: 1;
  grid-row: 2;
}

.dashboard-main {
  grid-column: 2;
  grid-row: 2;
}

.dashboard-sidebar-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-column: 1;
  grid-row: 1;
}

.dashboard-sidebar-subtitle {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-tertiary);
}

.dashboard-sidebar .card {
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
}

.dashboard-main-title-row {
  grid-column: 2;
  grid-row: 1;
  padding-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.player-list {
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
}

.player-list-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.player-list-item:hover {
  background: var(--bg-elevated);
}

.player-list-item.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.player-list-name {
  font-size: 14px;
  font-weight: 600;
}

.player-list-id {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', 'Menlo', monospace;
  margin-top: 2px;
}

.player-list-loading {
  display: flex;
  justify-content: center;
  padding: 30px;
}

.player-list-empty {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ===== Player Detail ===== */
.player-detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.player-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.player-detail-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.player-detail-id {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', 'Menlo', monospace;
}

.player-detail-actions {
  display: flex;
  gap: 8px;
}

.dash-card {
  padding: 20px;
}

/* ===== Info Grid ===== */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row:nth-child(odd) {
  padding-right: 20px;
}

.info-row:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.info-label {
  color: var(--text-tertiary);
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.info-value.mono {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
}

/* ===== Money ===== */
.money-display {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}

.money-sign {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-secondary);
}

.money-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-secondary);
  letter-spacing: -1px;
}

.money-display .btn {
  margin-left: 12px;
}

.money-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.money-row {
  display: flex;
  gap: 8px;
}

.money-btn {
  flex: 1;
  font-weight: 700;
}

.money-add {
  background: var(--accent-secondary-dim);
  color: var(--accent-secondary);
  border: 1px solid rgba(115, 204, 166, 0.2);
}

.money-add:hover {
  background: rgba(115, 204, 166, 0.2);
}

.money-sub {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(255, 90, 90, 0.2);
}

.money-sub:hover {
  background: rgba(255, 90, 90, 0.2);
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-health { background: var(--danger-dim); color: var(--danger); }
.stat-level { background: var(--warning-dim); color: var(--warning); }
.stat-xp { background: var(--accent-dim); color: var(--accent); }
.stat-ammo { background: var(--accent-secondary-dim); color: var(--accent-secondary); }

.stat-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
}

.stat-edit {
  flex-shrink: 0;
}

/* ===== Inventory Section ===== */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.inv-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  padding: 12px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.inv-group-header svg {
  width: 14px;
  height: 14px;
}

.inv-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.inv-item-row:hover {
  background: var(--bg-elevated);
}

.inv-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.inv-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inv-item-icon .no-icon svg {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
}

.inv-item-info {
  flex: 1;
  min-width: 0;
}

.inv-item-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  display: block;
}

.revoke-btn:hover {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
}

/* ===== Grant Modal ===== */
.grant-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.grant-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.grant-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.grant-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

.grant-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.grant-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.grant-item-row:hover {
  background: var(--accent-dim);
}

.grant-icon {
  display: flex;
  align-items: center;
  color: var(--accent-secondary);
  opacity: 0;
  transition: opacity var(--transition);
}

.grant-icon svg {
  width: 18px;
  height: 18px;
}

.grant-item-row:hover .grant-icon {
  opacity: 1;
}

/* ===== Logs Page ===== */
.logs-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.logs-table-wrapper {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.logs-table thead {
  position: sticky;
  top: 0;
}

.logs-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.logs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.logs-table tbody tr:hover {
  background: var(--bg-elevated);
}

.log-time {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', 'Menlo', monospace;
}

.log-admin {
  font-weight: 600;
  color: var(--accent);
}

.log-player-name {
  font-weight: 500;
  display: block;
}

.log-player-id {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', 'Menlo', monospace;
  display: block;
}

.log-details {
  font-size: 12px;
  color: var(--text-tertiary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-key {
  color: var(--text-secondary);
  font-weight: 600;
}

.logs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
}

.logs-total {
  font-size: 13px;
  color: var(--text-tertiary);
}

.pag-buttons {
  display: flex;
  gap: 4px;
}

input[type="date"] {
  color-scheme: dark;
}

/* ===== Home Page ===== */
.home-page {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.home-logo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  margin-bottom: 4px;
  box-shadow: 0 0 40px rgba(89, 153, 255, 0.35), 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  flex-shrink: 0;
}

.home-logo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--accent-dim);
  border: 1px solid rgba(89, 153, 255, 0.25);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.home-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-secondary);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.home-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.05;
}

.home-title-line {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -2px;
  display: block;
}

.home-title-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.home-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all 200ms ease;
  cursor: default;
}

.home-stat-card:hover {
  border-color: rgba(89, 153, 255, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(89, 153, 255, 0.08);
}

.home-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.home-stat-icon svg {
  width: 20px;
  height: 20px;
}

.home-stat-label {
  font-size: 15px;
  font-weight: 700;
}

.home-stat-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.home-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-cta {
  height: 48px;
  padding: 0 28px;
  font-size: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    position: static;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .info-row:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }
  .info-row:nth-child(odd) {
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .sidebar-brand span,
  .sidebar-section,
  .sidebar-link span {
    display: none;
  }
  .sidebar-brand {
    justify-content: center;
    padding: 20px 0;
  }
  .sidebar-link {
    justify-content: center;
    padding: 12px;
  }
  .main-content {
    margin-left: 60px;
  }
  .main-content .page { padding: 16px; }
  .page-title { font-size: 22px; }
  .items-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .search-input { width: 100%; }
  .logs-filters {
    grid-template-columns: 1fr;
  }
}
