:root {
  --bg-main: #0d0d1a;
  --bg-surface: #171728;
  --bg-surface-hover: #222238;
  --bg-card: #1c1c30;
  --color-primary: #c9a84c;
  --color-secondary: #4a6fa5;
  --text-main: #e0e0e0;
  --text-muted: #8c8c9e;
  --status-ready: #4caf50;
  --status-almost: #ff9800;
  --status-far: #f44336;
  --boss-gold: #ffd700;
  --star-1: #ffffff;
  --star-2: #4a9eff;
  --star-3: #ffd700;
  --border-subtle: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

/* ── Header ────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.8rem 1rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.brand {
  display: flex;
  flex-direction: column;
}

.app-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.app-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Seletor de Perfil / Personagem ────────────────── */
.profile-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
}

.profile-icon {
  font-size: 1.05rem;
  opacity: 0.9;
}

.profile-select {
  background: var(--bg-card);
  color: var(--color-primary);
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.profile-select:focus {
  border-color: #ffd700;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}
.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-primary);
}

.btn-share {
  background: rgba(74, 158, 255, 0.15);
  color: #72b2ff;
  border: 1px solid rgba(74, 158, 255, 0.35);
}
.btn-share:hover {
  background: rgba(74, 158, 255, 0.25);
  border-color: #9ac9ff;
  color: #fff;
}

.btn-export {
  background: rgba(76, 175, 80, 0.18);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.4);
  font-weight: 700;
}
.btn-export:hover {
  background: rgba(76, 175, 80, 0.32);
  border-color: #81c784;
  color: #fff;
}

/* ── Storage Status Badge no Header ── */
.storage-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.35);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #81c784;
  transition: all 0.2s ease;
  user-select: none;
}
.storage-badge-wrap:hover {
  background: rgba(76, 175, 80, 0.22);
  border-color: rgba(76, 175, 80, 0.6);
  color: #a5d6a7;
  transform: translateY(-1px);
}
.storage-status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-ready);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--status-ready);
  display: inline-block;
  animation: pulse-dot 2s infinite ease-in-out;
}
.storage-info-icon {
  font-size: 0.85rem;
  opacity: 0.8;
}
@keyframes pulse-dot {
  0% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.5; transform: scale(0.9); }
}

/* ── Storage Info Box (Banners em Abas) ── */
.storage-info-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(23, 23, 40, 0.7);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-left: 4px solid var(--color-primary);
  border-radius: 6px;
  padding: 0.75rem 1.1rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.storage-info-box-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-main);
  flex: 1;
  min-width: 270px;
}
.storage-info-icon-large {
  font-size: 1.5rem;
}
.storage-info-box-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Nav Tabs ──────────────────────────────────────── */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(23, 23, 40, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  max-width: 100%;
  margin: 0 auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--status-ready);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ── Main Container ────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

.tab-content {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
}

/* ── Toolbar & Search ──────────────────────────────── */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.95rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.4rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ── Filter Panel ──────────────────────────────────── */
.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  min-width: 65px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--color-primary);
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #0d0d1a;
  font-weight: 700;
}

.filter-chip.tt, .filter-chip.dusk {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

.filter-chip.sub {
  font-size: 0.8rem;
  border-radius: 4px;
}

.results-header {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ── Cards de Receita ──────────────────────────────── */
.recipe-card, .wishlist-item {
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-subtle);
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.recipe-card:hover, .wishlist-item:hover {
  background-color: var(--bg-surface-hover);
  border-color: rgba(201, 168, 76, 0.3);
  transform: translateY(-2px);
}

.recipe-card.stars-1 { border-left: 4px solid var(--star-1); }
.recipe-card.stars-2 { border-left: 4px solid var(--star-2); }
.recipe-card.stars-3 { border-left: 4px solid var(--star-3); }
.recipe-card.grade-green { border-left: 4px solid #10b981 !important; background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(20, 24, 33, 0.98) 100%) !important; }
.recipe-card.grade-green .recipe-name { color: #6ee7b7 !important; }
.recipe-card.grade-gold { border-left: 4px solid #f59e0b !important; background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(20, 24, 33, 0.98) 100%) !important; }
.recipe-card.grade-gold .recipe-name { color: #fbbf24 !important; }
.recipe-card.grade-orange { border-left: 4px solid #ef4444 !important; background: linear-gradient(135deg, rgba(239, 68, 68, 0.09) 0%, rgba(20, 24, 33, 0.98) 100%) !important; }
.recipe-card.grade-orange .recipe-name { color: #f87171 !important; }

.badge-gold { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); font-weight: 600; }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); font-weight: 600; }
.badge-orange { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); font-weight: 700; text-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }

.recipe-card-header, .wishlist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.recipe-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #fff;
}

.recipe-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.recipe-classes {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.class-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #ccc;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.badge-tt, .badge-dusk {
  background: rgba(201, 168, 76, 0.2);
  color: var(--color-primary);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.badge-sub {
  background: rgba(74, 111, 165, 0.2);
  color: #7ba6e0;
}

.badge-req {
  color: var(--text-muted);
}

.badge-mini {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  background: rgba(201, 168, 76, 0.2);
  color: var(--color-primary);
  margin-left: 0.4rem;
  font-weight: 700;
}

/* ── Materiais ─────────────────────────────────────── */
.recipe-materials {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.materials-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.4rem;
  font-weight: 600;
}

.material-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.15rem;
}

.material-tag.has-enough {
  background-color: rgba(76, 175, 80, 0.15);
  color: var(--status-ready);
  border-color: rgba(76, 175, 80, 0.4);
}

.material-tag.missing {
  background-color: rgba(244, 67, 54, 0.12);
  color: #ff756b;
  border-color: rgba(244, 67, 54, 0.35);
}

.material-tag.boss-mat {
  border-color: rgba(255, 215, 0, 0.4);
}

.mat-have {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 0.25rem;
}

/* ── Wishlist Layout ───────────────────────────────── */
.wishlist-item.stars-1 { border-left: 4px solid var(--star-1); }
.wishlist-item.stars-2 { border-left: 4px solid var(--star-2); }
.wishlist-item.stars-3 { border-left: 4px solid var(--star-3); }
.wishlist-item.grade-green { border-left: 4px solid #10b981 !important; }
.wishlist-item.grade-green .recipe-name { color: #6ee7b7 !important; }
.wishlist-item.grade-gold { border-left: 4px solid #f59e0b !important; }
.wishlist-item.grade-gold .recipe-name { color: #fbbf24 !important; }
.wishlist-item.grade-orange { border-left: 4px solid #ef4444 !important; }
.wishlist-item.grade-orange .recipe-name { color: #f87171 !important; }

.wishlist-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.status-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-indicator.status-ready { color: var(--status-ready); }
.status-indicator.status-almost { color: var(--status-almost); }
.status-indicator.status-far { color: var(--status-far); }

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease-in-out;
}
.progress-fill.ready { background-color: var(--status-ready); }
.progress-fill.almost { background-color: var(--status-almost); }
.progress-fill.far { background-color: var(--status-far); }

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.wishlist-materials {
  margin-top: 1rem;
}

/* ── Linhas de Inventário / Material Row ────────────── */
.material-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.material-row.row-boss {
  background: rgba(255, 215, 0, 0.03);
  border-left: 3px solid rgba(255, 215, 0, 0.4);
}

.material-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.material-qty {
  font-weight: 700;
  margin-right: 1rem;
  white-space: nowrap;
}

.material-complete {
  opacity: 0.55;
}
.material-complete .material-name {
  text-decoration: line-through;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-input {
  width: 55px;
  text-align: center;
  padding: 0.3rem;
  background-color: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  min-width: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Seções de Dusk no Inventário ──────────────────── */
.dusk-section {
  border: 1px solid var(--border-subtle);
  background-color: rgba(26, 26, 46, 0.4);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.dusk-section.boss-section {
  border-color: rgba(201, 168, 76, 0.3);
  background: rgba(201, 168, 76, 0.03);
}

.dusk-section.mob-section {
  border-color: rgba(100, 149, 237, 0.25);
  background: rgba(100, 149, 237, 0.02);
}

.dusk-section.essence-section {
  border-color: rgba(224, 86, 253, 0.3);
  background: rgba(224, 86, 253, 0.03);
}

.dusk-section h3, .material-list h3 {
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
  color: var(--color-primary);
}

.material-list {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-subtle);
}

/* ── Dashboard & Estatísticas ──────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.stat-card.stat-ready .stat-value { color: var(--status-ready); }
.stat-card.stat-almost .stat-value { color: var(--status-almost); }

.section-title {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  font-weight: 700;
}

.alerts-grid {
  margin-bottom: 2rem;
}

@keyframes glow-ready {
  0% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.2); }
  50% { box-shadow: 0 0 15px rgba(76, 175, 80, 0.45); }
  100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.2); }
}

@keyframes glow-almost {
  0% { box-shadow: 0 0 5px rgba(255, 152, 0, 0.2); }
  50% { box-shadow: 0 0 15px rgba(255, 152, 0, 0.45); }
  100% { box-shadow: 0 0 5px rgba(255, 152, 0, 0.2); }
}

.alert-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--bg-surface);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border-subtle);
}

.alert-card.ready {
  border-color: var(--status-ready);
  animation: glow-ready 2.5s infinite;
}

.alert-card.almost {
  border-color: var(--status-almost);
  animation: glow-almost 2.5s infinite;
}

.alert-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.alert-message {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.alert-percent {
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.top-materials {
  background: var(--bg-surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.welcome-box {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 2.5rem;
  text-align: center;
  border: 1px solid rgba(201, 168, 76, 0.25);
}

.welcome-box h2 {
  color: var(--color-primary);
  margin-bottom: 0.8rem;
}

.welcome-box p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 0.5rem auto;
}

/* ── Botões ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #0d0d1a;
}
.btn-primary:hover {
  background-color: #dfbe5b;
}

.btn-gold {
  background: linear-gradient(135deg, #ffd700, #c9a84c);
  color: #000;
  font-weight: 700;
  border: 1px solid #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #ffe033, #dfbe5b);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  color: #000;
}

.badge-in-wishlist {
  background: rgba(76, 175, 80, 0.2);
  color: var(--status-ready);
  border: 1px solid rgba(76, 175, 80, 0.4);
}

.btn-danger {
  background-color: var(--status-far);
  color: #fff;
}
.btn-danger:hover {
  background-color: #d32f2f;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

/* ── Modais ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background-color: var(--bg-surface);
  border-radius: 8px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
}

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

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}
.form-row .form-group { flex: 1; }

.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem;
  background-color: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* ── Toast Notifications ────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 2000;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success { background: var(--status-ready); color: #000; }
.toast-error { background: var(--status-far); color: #fff; }
.toast-info { background: var(--color-secondary); color: #fff; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--status-ready); }
/* ── Barra de Inclusão no Inventário ────────────────── */
.inventory-quick-bar {
  background: var(--bg-surface);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.quick-bar-header {
  margin-bottom: 0.85rem;
}

.quick-bar-header h3 {
  color: var(--color-primary);
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.quick-bar-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.quick-field {
  flex: 1;
  min-width: 200px;
}

.quick-field.qty-field {
  flex: 0 0 100px;
  min-width: 80px;
}

.quick-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

/* ── Botão de Quick Add no Material Tag ─────────────── */
.material-tag-wrapper {
  display: inline-flex;
  align-items: center;
  margin: 0.15rem;
}

.material-tag-wrapper .material-tag {
  margin: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.btn-tag-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.45rem;
  background: rgba(201, 168, 76, 0.25);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-left: none;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tag-add:hover {
  background: var(--color-primary);
  color: #000;
}

.btn-card-inv {
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--color-primary);
}

.btn-card-inv:hover {
  background: rgba(201, 168, 76, 0.3);
  color: #fff;
}

.search-hint {
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  display: inline-block;
}

/* ── Responsividade ────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .tab-nav {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .filter-group {
    flex-direction: column;
    align-items: flex-start;
  }
  .material-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .qty-control {
    align-self: flex-end;
  }
}

/* ── Onde Dropar & Tabelas de Dusk ─────────────────── */
.mat-drop-source {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: #5bc0be;
  background: rgba(91, 192, 190, 0.12);
  border: 1px solid rgba(91, 192, 190, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-top: 0.25rem;
  white-space: nowrap;
}

.table-chapter-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.table-chapter-btn {
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.table-chapter-btn:hover {
  border-color: var(--color-primary);
  color: var(--text-main);
}

.table-chapter-btn.active {
  background: rgba(201, 168, 76, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.table-img-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.table-img-wrapper {
  overflow: auto;
  max-height: 750px;
  border-radius: 6px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-dusk-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.table-dusk-img.zoomed {
  max-width: none;
  cursor: zoom-out;
}

.drops-summary-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-top: 1rem;
}

.drops-summary-table th {
  background: rgba(26, 26, 46, 0.8);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--color-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.drops-summary-table td {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drops-summary-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.tag-boss {
  font-weight: 700;
  color: #e0e1dd;
}

.tag-chapter {
  color: #778da9;
  font-size: 0.8rem;
}

.tag-gold-drop {
  color: #ffd166;
  font-weight: 600;
}

.tag-green-drop {
  color: #06d6a0;
}

/* ── Matriz Reconstruída em Alta Definição (Dusk Tables) ── */
.dusk-matrix-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.dusk-matrix-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dusk-matrix-title-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dusk-matrix-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dusk-matrix-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dusk-matrix-note-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.matrix-view-toggle {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.matrix-view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.matrix-view-btn:hover {
  color: var(--text-main);
}

.matrix-view-btn.active {
  background: rgba(201, 168, 76, 0.25);
  color: var(--color-primary);
  border: 1px solid rgba(201, 168, 76, 0.4);
}

.dusk-matrix-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.dusk-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dusk-matrix-table th {
  padding: 0.85rem 1rem;
  font-weight: 700;
  border-bottom: 2px solid rgba(201, 168, 76, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: #141423;
  color: var(--color-primary);
  white-space: nowrap;
}

.dusk-matrix-table th.col-submode {
  text-align: left;
  min-width: 260px;
}

.dusk-matrix-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.dusk-matrix-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.dusk-matrix-table .cell-boss {
  min-width: 180px;
  font-weight: 700;
}

.dusk-matrix-table .boss-name {
  color: #ff6b6b;
  font-size: 0.92rem;
  display: block;
}

.dusk-matrix-table .chest-name {
  color: #70a1ff;
  font-size: 0.92rem;
  display: block;
}

.dusk-matrix-table .cell-meta {
  text-align: center;
  white-space: nowrap;
}

.dusk-matrix-table .meta-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.matrix-drop-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.matrix-drop-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
  position: relative;
}

.matrix-drop-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(201, 168, 76, 0.4);
  transform: translateX(2px);
}

.matrix-drop-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 4px;
  object-fit: cover;
  background: #0d0d15;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.matrix-drop-card.rarity-green .matrix-drop-icon {
  border-color: rgba(0, 255, 174, 0.6);
  box-shadow: 0 0 6px rgba(0, 255, 174, 0.2);
}

.matrix-drop-card.rarity-gold .matrix-drop-icon {
  border-color: rgba(255, 209, 102, 0.8);
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.3);
}

.matrix-drop-card.rarity-orange .matrix-drop-icon {
  border-color: rgba(255, 119, 0, 0.9);
  box-shadow: 0 0 10px rgba(255, 119, 0, 0.4);
}

.matrix-drop-card.rarity-mob .matrix-drop-icon {
  border-color: rgba(160, 176, 192, 0.4);
}

.matrix-drop-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 0.1rem;
}

.matrix-drop-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.matrix-drop-card.rarity-green .matrix-drop-name {
  color: #00ffae;
}

.matrix-drop-card.rarity-gold .matrix-drop-name {
  color: #ffd166;
}

.matrix-drop-card.rarity-orange .matrix-drop-name {
  color: #ff9f1c;
}

.matrix-drop-card.rarity-mob .matrix-drop-name {
  color: #b0bec5;
}

.matrix-drop-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.matrix-drop-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.matrix-action-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-action-btn:hover {
  background: rgba(201, 168, 76, 0.2);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.matrix-empty {
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
  font-size: 0.82rem;
  text-align: center;
  display: block;
  padding: 0.5rem 0;
}

.matrix-footer-note {
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   VISÃO DE FORNALHA (CALDEIRÕES DE DUSK)
   ═══════════════════════════════════════════════════════════ */

.furnace-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Cauldron Selector (As 4 Fornalhas) ── */
.furnace-cauldrons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.cauldron-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.cauldron-card:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(201, 168, 76, 0.4);
  transform: translateY(-2px);
}

.cauldron-card.active {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15) 0%, rgba(28, 28, 48, 0.95) 100%);
  border-color: var(--color-primary);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.25);
}

.cauldron-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #c9a84c, #ffd700);
}

.cauldron-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.cauldron-info {
  flex: 1;
}

.cauldron-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cauldron-card.active .cauldron-name {
  color: var(--color-primary);
}

.cauldron-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.cauldron-badge {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  color: #bbb;
  font-weight: 600;
}

.cauldron-card.active .cauldron-badge {
  background: rgba(201, 168, 76, 0.25);
  color: #ffd700;
  border: 1px solid rgba(201, 168, 76, 0.4);
}

/* ── Controls Bar (Levels & Types) ── */
.furnace-controls-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.furnace-control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.furnace-control-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
}

.furnace-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.furnace-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.furnace-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.furnace-chip.active {
  background: var(--color-primary);
  border-color: #ffd700;
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.35);
}

.furnace-chip.chip-tt, .furnace-chip.chip-dusk {
  font-family: monospace;
  font-size: 0.88rem;
  padding: 0.4rem 0.9rem;
}

.furnace-chip.chip-tt.active, .furnace-chip.chip-dusk.active {
  background: linear-gradient(135deg, #c9a84c 0%, #e6c567 100%);
}

.furnace-chip.chip-grade-gold.active {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #000;
}

.furnace-chip.chip-grade-green.active {
  background: #10b981;
  border-color: #34d399;
  color: #000;
}

/* ── Workspace (2 Columns: Catalog + Workbench) ── */
.furnace-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 992px) {
  .furnace-workspace {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* ── Catalog Panel ── */
.furnace-catalog {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.furnace-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.furnace-group-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.furnace-group-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.furnace-group-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.furnace-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
  padding: 0.85rem;
}

/* ── Item Slot Card ── */
.furnace-item-slot {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.furnace-item-slot:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(201, 168, 76, 0.35);
  transform: translateY(-1px);
}

.furnace-item-slot.selected {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.14) 0%, rgba(30, 30, 50, 0.95) 100%);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.25);
}

.furnace-item-slot.grade-gold {
  border-left: 3px solid #f59e0b;
}

.furnace-item-slot.grade-green {
  border-left: 3px solid #10b981;
}

.furnace-item-slot.grade-orange {
  border-left: 3px solid #ef4444;
}

.furnace-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.furnace-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.furnace-item-slot.grade-gold .furnace-item-name {
  color: #fbbf24;
}

.furnace-item-slot.grade-green .furnace-item-name {
  color: #6ee7b7;
}

.furnace-item-slot.grade-orange .furnace-item-name {
  color: #f87171;
}

.furnace-item-stars {
  font-size: 0.75rem;
  color: #ffd700;
  letter-spacing: -1px;
}

.furnace-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.furnace-item-status {
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.35rem;
}

.status-badge-ready {
  color: #4caf50;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.status-badge-collecting {
  color: #f59e0b;
  font-weight: 600;
}

.status-badge-wishlist {
  color: #ffd700;
  font-size: 0.7rem;
}

/* ── Workbench Panel (Sticky Caldeirão) ── */
.furnace-bench-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 80px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.furnace-bench-header {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12) 0%, rgba(23, 23, 40, 0.95) 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.1rem 1.25rem;
}

.furnace-bench-card.grade-green {
  border-color: rgba(16, 185, 129, 0.4);
}
.furnace-bench-card.grade-green .furnace-bench-header {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(23, 23, 40, 0.95) 100%);
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}
.furnace-bench-card.grade-green .bench-item-name {
  color: #6ee7b7;
}

.furnace-bench-card.grade-gold {
  border-color: rgba(245, 158, 11, 0.4);
}
.furnace-bench-card.grade-gold .furnace-bench-header {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(23, 23, 40, 0.95) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}
.furnace-bench-card.grade-gold .bench-item-name {
  color: #fbbf24;
}

.furnace-bench-card.grade-orange {
  border-color: rgba(239, 68, 68, 0.4);
}
.furnace-bench-card.grade-orange .furnace-bench-header {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(23, 23, 40, 0.95) 100%);
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}
.furnace-bench-card.grade-orange .bench-item-name {
  color: #f87171;
}

.bench-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.bench-item-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.bench-badge-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.bench-actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.furnace-bench-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Progress Bar in Workbench ── */
.bench-progress-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
}

.bench-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.bench-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.bench-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bench-progress-fill.ready {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.bench-progress-fill.almost {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.bench-progress-fill.far {
  background: linear-gradient(90deg, #4a6fa5, #6366f1);
}

/* ── Materials List in Workbench ── */
.bench-materials-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bench-mat-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background 0.15s ease;
}

.bench-mat-card.mat-enough {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.03);
}

.bench-mat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.bench-mat-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bench-mat-qty {
  font-size: 0.85rem;
  font-weight: 700;
}

.bench-mat-qty.enough {
  color: #34d399;
}

.bench-mat-qty.missing {
  color: #f87171;
}

.bench-mat-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.1rem;
}

.bench-mat-stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.bench-step-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bench-step-btn:hover {
  background: var(--color-primary);
  color: #000;
  border-color: #ffd700;
}

.bench-drop-link {
  font-size: 0.75rem;
  color: #778da9;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.bench-drop-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ── Ícones dos Itens e Molduras de Grau ───────────────── */
.item-icon-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  overflow: hidden;
}

.item-icon-frame.grade-green {
  border-color: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
}

.item-icon-frame.grade-gold {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.item-icon-frame.grade-orange {
  border-color: #f97316;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}

.item-icon-32 {
  width: 32px;
  height: 32px;
}

.item-icon-32 img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  display: block;
}

.item-icon-40 {
  width: 40px;
  height: 40px;
}

.item-icon-40 img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  display: block;
}

.item-icon-48 {
  width: 48px;
  height: 48px;
}

.item-icon-48 img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  display: block;
}

.item-icon-24 {
  width: 24px;
  height: 24px;
}

.item-icon-24 img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  display: block;
}

.mat-icon-sm {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  vertical-align: middle;
  margin-right: 0.35rem;
  background: rgba(0, 0, 0, 0.4);
  image-rendering: pixelated;
  flex-shrink: 0;
  display: inline-block;
}

/* ── Tooltip / Painel de Atributos Clássico do Perfect World ── */
.pw-item-tooltip {
  background: rgba(11, 14, 26, 0.95);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 8px;
  padding: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
  text-align: left;
}

.pw-tt-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.65rem;
}

.pw-tt-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.pw-tt-name.grade-gold {
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.3);
}

.pw-tt-name.grade-orange {
  color: #ff9f1c;
  text-shadow: 0 0 10px rgba(255, 159, 28, 0.4);
}

.pw-tt-name.grade-green {
  color: #06d6a0;
  text-shadow: 0 0 8px rgba(6, 214, 160, 0.3);
}

.pw-tt-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.pw-tt-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.pw-tt-row {
  display: flex;
  justify-content: space-between;
  color: #e2e8f0;
}

.pw-tt-label {
  color: #94a3b8;
}

.pw-tt-val {
  color: #fff;
  font-weight: 600;
}

.pw-tt-reqs {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  border-left: 2px solid #64748b;
}

.pw-tt-addons-box {
  background: rgba(0, 180, 216, 0.05);
  border: 1px dashed rgba(0, 180, 216, 0.35);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}

.pw-tt-addons-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #48cae4;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pw-addon-line {
  font-size: 0.84rem;
  color: #70d6ff;
  font-weight: 600;
  margin: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pw-addon-line::before {
  content: '✦';
  color: #00b4d8;
  font-size: 0.75rem;
}

/* Card compacto de adds no Catálogo */
.recipe-adds-preview {
  margin-top: 0.6rem;
  padding: 0.45rem 0.65rem;
  background: rgba(0, 180, 216, 0.04);
  border: 1px solid rgba(0, 180, 216, 0.2);
  border-radius: 6px;
  font-size: 0.78rem;
}

.recipe-adds-preview .adds-preview-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #48cae4;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.recipe-adds-preview ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recipe-adds-preview li {
  color: #70d6ff;
  font-weight: 500;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



/* ── Inventário: visões, venda e preços ───────────────────── */
.inv-views { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 0.4rem; }
.inv-price-info { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.inv-price-info a { color: var(--color-primary); }
.inv-price { font-size: 0.82rem; white-space: nowrap; color: #ffd166; text-decoration: none; margin-left: auto; padding: 0 0.6rem; }
.inv-price:hover { text-decoration: underline; }
.inv-sell-controls { display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem; align-items: center; margin: 0.8rem 0 1rem; font-size: 0.88rem; }
.inv-sell-controls .qty-input { width: 64px; margin: 0 0.3rem; }
.inv-check { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.inv-sell-group { margin-top: 1.2rem; }
.inv-group-total { font-size: 0.85rem; font-weight: normal; margin-left: 0.4rem; }
.inv-group-hint { font-size: 0.8rem; margin: -0.3rem 0 0.6rem; }
.inv-sell-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 0.9rem; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border-subtle); }
.inv-sell-row .material-name { flex: 1 1 240px; min-width: 200px; }
.inv-sell-row .inv-price { margin-left: 0; }
.inv-col { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.inv-col strong { color: var(--text-main); }
.inv-keep { width: 58px; margin-left: 0.25rem; }
.inv-sell-qty strong { color: var(--status-ready); }
.inv-value { min-width: 64px; color: #ffd166; }
.badge-mini.badge-sell { background: rgba(76, 175, 80, 0.18); color: var(--status-ready); border-color: rgba(76, 175, 80, 0.4); }
@media (max-width: 640px) {
  .inv-sell-row .material-name { flex-basis: 100%; }
  .inv-price { margin-left: 0; }
}

/* ── Forjas Normais ───────────────────────────────────────── */
.badge-normal { background: rgba(125, 160, 255, 0.14); color: #a9c1ff; border: 1px solid rgba(125, 160, 255, 0.35); }
.badge-white { background: rgba(255, 255, 255, 0.08); color: #e6e6e6; border: 1px solid rgba(255, 255, 255, 0.25); }
.badge-blue { background: rgba(80, 150, 255, 0.15); color: #7fb2ff; border: 1px solid rgba(80, 150, 255, 0.4); }
.badge-purple { background: rgba(176, 102, 255, 0.15); color: #cf9bff; border: 1px solid rgba(176, 102, 255, 0.4); }
.badge-price { background: rgba(255, 209, 102, 0.12); color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.35); text-decoration: none; }
.grade-white .item-icon-frame, .item-icon-frame.grade-white { border-color: rgba(255, 255, 255, 0.35); }
.item-icon-frame.grade-purple { border-color: #b066ff; }
.item-icon-frame.grade-blue { border-color: #5096ff; }

.forge-top { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.forge-professions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.forge-search { flex: 1 1 280px; max-width: 460px; }
.forge-services { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin-bottom: 1rem; }
.forge-services .form-select { min-width: 260px; max-width: 100%; }
.forge-pages { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.forge-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.forge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.55rem; }
.forge-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.6rem 0.4rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 8px; color: var(--text-main); cursor: pointer; text-align: center; font: inherit; }
.forge-slot:hover { border-color: var(--color-primary); }
.forge-slot.selected { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary) inset; }
.forge-slot-name { font-size: 0.78rem; line-height: 1.25; }
.forge-slot.grade-purple .forge-slot-name { color: #cf9bff; }
.forge-slot.grade-blue .forge-slot-name { color: #7fb2ff; }
.forge-slot.grade-gold .forge-slot-name { color: #ffd166; }
.forge-slot.grade-green .forge-slot-name { color: #7ddf8a; }
.forge-slot-meta { font-size: 0.7rem; color: var(--text-muted); }
.forge-slot-flag { position: absolute; top: 4px; right: 6px; font-size: 0.8rem; }
.forge-slot-status { position: absolute; top: 4px; left: 6px; font-size: 0.7rem; }
.forge-workbench { position: sticky; top: 0.5rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 1rem; max-height: calc(100vh - 1rem); overflow-y: auto; }
.forge-bench-head { display: flex; gap: 0.8rem; align-items: flex-start; }
.forge-bench-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }
.forge-section { margin-top: 0.9rem; }
.forge-section-title { font-weight: 600; font-size: 0.88rem; color: var(--color-primary); margin-bottom: 0.4rem; cursor: default; }
details.forge-section summary { cursor: pointer; }
.forge-output { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; font-size: 0.85rem; }
.forge-output-name { flex: 1; }
.forge-output.grade-purple .forge-output-name { color: #cf9bff; }
.forge-output-chance { color: #ffd166; font-variant-numeric: tabular-nums; }
.forge-attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.25rem 0.8rem; font-size: 0.8rem; }
.forge-attr { display: flex; justify-content: space-between; gap: 0.5rem; border-bottom: 1px dashed var(--border-subtle); padding: 0.15rem 0; }
.forge-attr span { color: var(--text-muted); }
.forge-prob { margin-bottom: 0.35rem; font-size: 0.8rem; }
.forge-prob-title { color: var(--text-muted); margin-bottom: 0.2rem; }
.forge-addons { columns: 2; font-size: 0.78rem; padding-left: 1.1rem; margin: 0.3rem 0 0; }
.forge-desc, .forge-source, .forge-footnote { font-size: 0.75rem; margin-top: 0.8rem; }
.forge-source a { color: var(--color-primary); }
@media (max-width: 900px) {
  .forge-layout { grid-template-columns: 1fr; }
  .forge-workbench { position: static; max-height: none; }
  .forge-addons { columns: 1; }
}

/* ── Revisão UX (Hathor, 2026-09-17) ──────────────────────── */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.toast-action { margin-left: 0.6rem; background: rgba(0, 0, 0, 0.25); color: inherit; border: 1px solid currentColor; border-radius: 4px; padding: 0.15rem 0.55rem; cursor: pointer; font: inherit; font-weight: 600; }
.inv-sold { display: inline-flex; align-items: center; gap: 0.35rem; }
.inv-sold-qty { width: 64px; }
.inv-default { font-size: 0.72rem; margin-left: 0.25rem; }
.inv-hint { font-size: 0.8rem; margin: 1rem 0 0; }
.forge-limit { grid-column: 1 / -1; font-size: 0.8rem; margin: 0 0 0.4rem; }
@media (max-width: 640px) {
  .inv-sell-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem 0.5rem; align-items: center; }
  .inv-sell-row .material-name, .inv-sell-row .inv-sold { grid-column: 1 / -1; min-width: 0; }
  .inv-sell-row .inv-sold { justify-content: flex-end; }
  .forge-services .form-select { min-width: 0; width: 100%; }
  .badge-mini, .forge-slot-meta { font-size: 0.72rem; }
}

/* ── Retratos dos bosses na tabela de drops ───────────────── */
.boss-cell { display: flex; align-items: center; gap: 0.55rem; }
.boss-portrait { object-fit: cover; border-radius: 8px; border: 1px solid rgba(255, 209, 102, 0.35); background: #0d0d18; flex-shrink: 0; }
.boss-portrait-md { width: 52px; height: 52px; }
.boss-portrait-sm { width: 26px; height: 26px; border-radius: 5px; margin-right: 0.35rem; vertical-align: middle; }
.tag-boss { display: inline-flex; align-items: center; }
@media (max-width: 640px) {
  .boss-portrait-md { width: 38px; height: 38px; }
}

/* ── Mini-gráfico de preço ───────────────────────────────── */
.sparkline { margin-left: 0.3rem; vertical-align: middle; }
.sparkline-up polyline { stroke: #4caf50; }
.sparkline-down polyline { stroke: #ef5350; }

/* ── Quantidade na Wishlist ──────────────────────────────── */
.wish-qty { display: inline-flex; align-items: center; gap: 0.3rem; margin-right: 0.5rem; }
.wish-qty strong { min-width: 2.2ch; text-align: center; color: var(--color-primary); }
.wish-qty .btn-icon[disabled] { opacity: 0.35; cursor: default; }

.inv-live-refresh { margin-left: 0.4rem; padding: 0.05rem 0.5rem; font-size: 0.75rem; }
.inv-price-btn { white-space: nowrap; }
.inv-price strong { color: #ffd166; }
.inv-price-refresh { margin-left: 0.2rem; }
.inv-price-link { margin-left: 0.3rem; color: var(--text-muted); text-decoration: none; }

.forge-make { margin-left: 0.4rem; padding: 0 0.45rem; font-size: 0.72rem; }

/* ── Itens que não existem no servidor 1.2.6 ─────────────── */
.badge-144 { background: rgba(239, 83, 80, 0.14); color: #ff8a80; border: 1px solid rgba(239, 83, 80, 0.4); }
.server-toggle { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: 0.8rem; font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }

.price-game { display: inline-block; width: auto; padding: 0.1rem 0.4rem; font-size: 0.78rem; }
