/* Dashboard & Admin */
.page-dash,
.page-auth {
  background: var(--bg);
  min-height: 100vh;
}

.page-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-wrap {
  width: min(440px, 100%);
}

.auth-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.auth-logo {
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.auth-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.btn-bnet {
  background: linear-gradient(135deg, #148eff, #0056b3);
  color: #fff;
  gap: 0.75rem;
}

.btn-bnet:hover {
  color: #fff;
  box-shadow: 0 4px 20px rgba(20, 142, 255, 0.4);
}

.auth-features {
  list-style: none;
  margin: 1.5rem 0;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-features li {
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.auth-features li::before {
  content: "⚔";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

.auth-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Dashboard header */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  background: rgba(10, 8, 8, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.dash-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--gold);
  margin-right: 0.25rem;
}

.nav-link--ghost {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

.nav-link--admin {
  color: var(--gold) !important;
}

.dash-main {
  padding: 2rem 1rem 4rem;
}

.dash-hero {
  margin-bottom: 2.5rem;
}

.dash-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.35rem;
}

.dash-hero p {
  color: var(--text-muted);
}

.dash-section {
  margin-bottom: 3rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: #fff;
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(180, 60, 60, 0.5);
  color: #f0a0a0;
  padding: 0.25rem 0.6rem;
  font-size: 1rem;
  line-height: 1;
}

/* Characters */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.char-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: border-color 0.2s;
}

.char-card--main {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.15);
}

.char-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--bg) center/cover no-repeat;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.char-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.char-card__realm {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.char-card__meta {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(196, 30, 30, 0.2);
  color: var(--accent-bright);
  margin-top: 0.5rem;
}

.badge--main {
  background: rgba(201, 162, 39, 0.2);
  color: var(--gold);
}

.badge--p1 { background: rgba(255, 68, 34, 0.2); color: #ff6644; }
.badge--p2 { background: rgba(105, 204, 240, 0.15); color: #69ccf0; }
.badge--p3 { background: rgba(148, 130, 201, 0.15); color: #9482c9; }
.badge--admin { background: rgba(201, 162, 39, 0.2); color: var(--gold); }

.badge--status-pending { background: rgba(255, 165, 0, 0.15); color: #ffa500; }
.badge--status-accepted { background: rgba(60, 180, 90, 0.15); color: #8fd4a0; }
.badge--status-rejected { background: rgba(180, 60, 60, 0.15); color: #f0a0a0; }
.badge--status-contacted { background: rgba(105, 204, 240, 0.15); color: #69ccf0; }

/* Wishlist form */
.wish-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow: visible;
}

.wish-form .form-row {
  overflow: visible;
}

.dash-section {
  overflow: visible;
}

.wish-search-block {
  position: relative;
  z-index: 30;
  margin-bottom: 1.25rem;
}

.wish-search-block label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.wish-search-block input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.wish-search-block input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: #1a1414;
  border: 1px solid var(--accent);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.search-results:not(.search-results--visible) {
  display: none;
}

.search-results--visible {
  display: block;
}

.search-hint {
  padding: 0.75rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #1a1414;
}

.search-hint--error {
  color: #f0a0a0;
}

.search-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.85rem;
  background: #1a1414;
  border: none;
  border-bottom: 1px solid var(--border);
  color: #e8e0dc;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover,
.search-result:focus {
  background: rgba(196, 30, 30, 0.25);
  outline: none;
}

/* Item quality colors */
.quality-legendary, .quality-legendary { color: #ff8000; }
.quality-epic { color: #a335ee; }
.quality-rare { color: #0070dd; }
.quality-uncommon { color: #1eff00; }
.quality-common { color: #9d9d9d; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-elevated);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.row-obtained {
  opacity: 0.45;
}

.actions {
  white-space: nowrap;
}

.wishlist-wrap {
  overflow-x: auto;
}

.empty-state {
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Admin */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-card--accent {
  border-color: var(--accent);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.admin-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.admin-card__head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.muted {
  color: var(--text-muted);
  font-weight: 400;
}

.admin-card__msg {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.admin-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.admin-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select,
.role-select,
.app-status-select,
.app-notes {
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.app-notes {
  flex: 1;
  min-width: 120px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--error {
  border-color: rgba(180, 60, 60, 0.5);
  color: #f0a0a0;
}

@media (max-width: 600px) {
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem;
  }
}
