/* ==========================================================================
   PARTYFINDER CLOUD STUDIO v2 - ESPORTS DESIGN SYSTEM
   Strategy 1 Deep Realm Harvester & Role Metric Engine
   ========================================================================== */

@font-face {
  font-family: 'Naowh';
  src: url('fonts/Naowh.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GothamNarrowUltra';
  src: url('fonts/GothamNarrowUltra.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Strictly Preserved Naowh & Gotham Fonts */
  --font-naowh: 'Naowh', 'NaowhAsia', sans-serif;
  --font-gotham: 'GothamNarrowUltra', 'GothamNarrowUltraAsia', sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-number: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Naowh', 'GothamNarrowUltra', 'Inter', sans-serif;
  --font-brand: 'Naowh', 'GothamNarrowUltra', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;

  /* Minia Minimalist Dark Obsidian Surfaces */
  --bg-app: #0b0e14;
  --bg-header: #10151f;
  --bg-card: #141a26;
  --bg-card-hover: #18202f;
  --bg-card-sub: #171d2b;
  --bg-terminal: #090c12;
  --bg-input: #0e131d;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: #5156be;
  --border-glow-cyan: rgba(56, 189, 248, 0.25);
  --border-glow-emerald: rgba(16, 185, 129, 0.25);
  --border-glow-amber: rgba(245, 158, 11, 0.25);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Minia Refined Color Accents & Subtleties */
  --primary: #5156be;
  --primary-subtle: rgba(81, 86, 190, 0.15);
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.15);
  --cyan-subtle: rgba(56, 189, 248, 0.12);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --emerald-subtle: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --amber-subtle: rgba(245, 158, 11, 0.12);
  --purple: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.15);
  --purple-subtle: rgba(168, 85, 247, 0.12);
  --rose: #ef4444;
  --rose-glow: rgba(239, 68, 68, 0.15);
  --rose-subtle: rgba(239, 68, 68, 0.12);

  /* Class Colors */
  --c-deathknight: #C41E3A;
  --c-demonhunter: #A330C9;
  --c-druid: #FF7C0A;
  --c-evoker: #33937F;
  --c-hunter: #AAD372;
  --c-mage: #3FC7EB;
  --c-monk: #00FF98;
  --c-paladin: #F48CBA;
  --c-priest: #FFFFFF;
  --c-rogue: #FFF468;
  --c-shaman: #0070DD;
  --c-warlock: #8788EE;
  --c-warrior: #C69B6D;

  /* Parse Tier Colors (Warcraft Logs Canonical) */
  --parse-100: #e5cc80;
  --parse-99: #e268a8;
  --parse-legendary: #ff8000;
  --parse-epic: #a335ee;
  --parse-rare: #0070dd;
  --parse-uncommon: #1eff00;
  --parse-common: #9d9d9d;
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  user-select: none;
  font-size: 13px;
  line-height: 1.4;
  font-kerning: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4,
.brand-title,
.nav-btn,
.col-title,
.phase-title,
.strat-title,
.qs-title,
.reg-title,
.btn,
.stat-title,
.table-char-name,
.vcard-name {
  font-family: var(--font-heading);
  letter-spacing: 0.4px;
}

.stat-number,
.cycle-num,
.reg-count,
.vcard-score-num,
.tier-pill,
.reg-p1-tag,
.reg-p2-tag,
.reg-p3-tag,
.reg-total-tag,
.badge,
.strat-badge {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.stat-number,
.cycle-num,
.reg-count,
.vcard-score-num {
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   MINIA UTILITY CLASSES & SOFT BADGES
   -------------------------------------------------------------------------- */
.avatar-xs {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-sm {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-md {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-title {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 22px;
}

.avatar-title i,
.avatar-title .bx {
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-sm .avatar-title i,
.avatar-sm .avatar-title .bx,
.avatar-sm i.font-size-22 {
  font-size: 24px !important;
}

.font-size-12 { font-size: 12px !important; }
.font-size-13 { font-size: 13px !important; }
.font-size-14 { font-size: 14px !important; }
.font-size-16 { font-size: 16px !important; }
.font-size-18 { font-size: 18px !important; }
.font-size-20 { font-size: 20px !important; }
.font-size-22 { font-size: 22px !important; }
.font-size-24 { font-size: 24px !important; }
.font-size-26 { font-size: 26px !important; }

.rounded-circle {
  border-radius: 50% !important;
}

.bg-info-subtle { background-color: rgba(56, 189, 248, 0.12) !important; color: #38bdf8 !important; }
.bg-success-subtle { background-color: rgba(16, 185, 129, 0.12) !important; color: #34d399 !important; }
.bg-warning-subtle { background-color: rgba(245, 158, 11, 0.12) !important; color: #fbbf24 !important; }
.bg-purple-subtle { background-color: rgba(168, 85, 247, 0.12) !important; color: #c084fc !important; }
.bg-danger-subtle { background-color: rgba(239, 68, 68, 0.12) !important; color: #f87171 !important; }
.bg-primary-subtle { background-color: rgba(81, 86, 190, 0.15) !important; color: #8287ea !important; }

/* Minia Soft Badges */
.badge-soft-info {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-soft-success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-soft-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-soft-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-soft-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.studio-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  height: 60px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-crest {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.crest-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

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

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #000;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.8px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 14px;
  background: rgba(20, 26, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.status-cdn .pill-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-cdn .pill-val {
  color: var(--emerald);
  font-weight: 700;
  font-family: var(--font-heading);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 3px var(--emerald); }
  50% { transform: scale(1.2); box-shadow: 0 0 8px var(--emerald); }
  100% { transform: scale(0.95); box-shadow: 0 0 3px var(--emerald); }
}

.status-rate .pill-icon {
  width: 12px;
  height: 12px;
  color: #c084fc;
}
.status-rate .pill-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-rate .pill-val {
  color: #c084fc;
  font-weight: 700;
  font-family: var(--font-heading);
}

.header-right {
  display: flex;
  align-items: center;
}

.nav-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-heading);
  letter-spacing: 0.4px;
}

.nav-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn.active {
  color: #fff;
  background: rgba(81, 86, 190, 0.22);
  border: 1px solid rgba(81, 86, 190, 0.45);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   BODY & TAB PANES
   -------------------------------------------------------------------------- */
.studio-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.25) 0%, transparent 70%), var(--bg-app);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}

.studio-body:has(#tab-deck.active) {
  overflow: hidden;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.tab-pane.active {
  display: flex;
  flex: 1;
  min-height: 0;
}

.tab-pane#tab-deck.active {
  height: 100%;
  overflow: hidden;
}

/* General Card (Minia Clean Elevated) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.card:hover {
  border-color: var(--border-medium);
}

/* --------------------------------------------------------------------------
   AUTOPILOT BANNER (Minia Executive Deck)
   -------------------------------------------------------------------------- */
.autopilot-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  padding: 14px 20px;
  flex-shrink: 0;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.autopilot-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.autopilot-phase-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.phase-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.3px;
}

.phase-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cycle-counter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cycle-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cycle-num {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.timer-num {
  color: var(--amber);
}

.btn-autopilot {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-autopilot:hover {
  background: rgba(245, 158, 11, 0.25);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.btn-autopilot-stop {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-autopilot-stop:hover {
  background: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

/* --------------------------------------------------------------------------
   TELEMETRY GRID
   -------------------------------------------------------------------------- */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  flex-shrink: 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

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

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.stat-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 0 0;
}

.stat-number {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.1;
}

.stat-unit {
  font-size: 11px;
  color: var(--text-dim);
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.stat-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

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

.fill-emerald {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* --------------------------------------------------------------------------
   QUICK PLAYER VERIFICATION & SEARCH SECTION (Option C)
   -------------------------------------------------------------------------- */
.quick-search-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.quick-search-header {
  margin-bottom: 12px;
}

.qs-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.qs-icon {
  width: 18px;
  height: 18px;
  color: var(--cyan);
  stroke-width: 2.5;
}

.qs-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.qs-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
}

.qs-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.quick-search-form {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.qs-input-group, .qs-select-group {
  position: relative;
  display: flex;
  align-items: center;
}

.qs-input-group {
  flex: 2;
}

.qs-select-group {
  flex: 1.2;
}

.input-icon {
  position: absolute;
  left: 12px;
  pointer-events: none;
  font-size: 14px;
  opacity: 0.7;
}

.qs-input, .qs-select {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0 14px 0 36px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.qs-input:focus, .qs-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.btn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.35);
}

.btn-search:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

/* Verification Result Card */
.verification-card {
  margin-top: 14px;
  background: rgba(11, 15, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

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

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

.vcard-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.class-crest {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.vcard-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.vcard-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.vcard-realm {
  font-size: 13px;
  color: var(--text-muted);
}

.vcard-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.vcard-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.vcard-status-pill.verified {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald);
}

.vcard-status-pill.unverified {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--rose);
}

.vcard-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.vcard-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  padding: 14px 0;
}

.metric-highlight-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glow-amber);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.5px;
}

.metric-val-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0;
}

.metric-score {
  font-size: 32px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1;
}

.metric-unit {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dim);
}

.parse-pill {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pill-100 { background: rgba(229, 204, 128, 0.2); color: var(--parse-100); border: 1px solid var(--parse-100); }
.pill-99 { background: rgba(226, 104, 168, 0.2); color: var(--parse-99); border: 1px solid var(--parse-99); }
.pill-legendary { background: rgba(255, 128, 0, 0.2); color: var(--parse-legendary); border: 1px solid var(--parse-legendary); }
.pill-epic { background: rgba(163, 53, 238, 0.2); color: var(--parse-epic); border: 1px solid var(--parse-epic); }
.pill-rare { background: rgba(0, 112, 221, 0.2); color: var(--parse-rare); border: 1px solid var(--parse-rare); }
.pill-uncommon { background: rgba(30, 255, 0, 0.2); color: var(--parse-uncommon); border: 1px solid var(--parse-uncommon); }
.pill-common { background: rgba(157, 157, 157, 0.2); color: var(--parse-common); border: 1px solid var(--parse-common); }

.metric-explanation {
  font-size: 11px;
  color: var(--text-muted);
}

.vcard-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(15, 23, 42, 0.3);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
}

.detail-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.d-label {
  font-size: 11px;
  color: var(--text-dim);
}

.d-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.vcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.btn-rio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  transition: all 0.15s;
  cursor: pointer;
}

.btn-rio:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.btn-wcl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium);
  transition: all 0.15s;
  cursor: pointer;
}

.btn-wcl:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.btn-wcl svg,
.btn-rio svg {
  width: 14px;
  height: 14px;
}

.vcard-tip {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   ACTION DECK (Manual Overrides)
   -------------------------------------------------------------------------- */
.action-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-sub);
  padding: 12px 18px;
  flex-shrink: 0;
}

.deck-mode-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deck-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.mode-pills {
  display: flex;
  gap: 6px;
}

.mode-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.mode-pill.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 8px var(--cyan-glow);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-cyan { background: var(--cyan); }
.dot-emerald { background: var(--emerald); }
.dot-purple { background: var(--purple); }

.deck-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  box-sizing: border-box;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  color: #ffffff;
  white-space: nowrap;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
}

.deck-buttons .btn-start,
.deck-buttons .btn-pause,
.deck-buttons .btn-stop {
  min-width: 106px;
}

.deck-buttons .btn-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.btn-hero {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: rgba(52, 211, 153, 0.4);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.btn-hero:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.55);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--amber);
}

.btn-warning:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fbbf24;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
  cursor: pointer;
}

.btn-warning:not(:disabled):hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.65);
}

.btn-warning.is-paused {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  animation: pulseResumeBtn 1.5s infinite alternate ease-in-out;
}

@keyframes pulseResumeBtn {
  0% { box-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }
  100% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.85); }
}

.btn-warning:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--rose);
}

.btn-danger:not(:disabled) {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  border-color: #fb7185;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.55);
  cursor: pointer;
  animation: pulseStopBtn 1.5s infinite alternate ease-in-out;
}

@keyframes pulseStopBtn {
  0% { box-shadow: 0 0 10px rgba(244, 63, 94, 0.4); }
  100% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.85); }
}

.deck-buttons .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  animation: none !important;
}

#btnStartJob:disabled,
.btn-hero:disabled,
.deck-buttons .btn-hero:disabled {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
  color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 0.45 !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   SPLIT VIEW (Live Player Cards & Console Stream)
   -------------------------------------------------------------------------- */
.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
}

.split-column {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.col-title svg {
  width: 15px;
  height: 15px;
  color: var(--cyan);
}

/* Player Stream */
.player-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.stream-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 280px;
  color: var(--text-dim);
  text-align: center;
  gap: 8px;
}

.empty-icon {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

.empty-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.empty-sub {
  font-size: 12px;
  max-width: 250px;
}

/* Stream Player Card */
.player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: all 0.15s ease;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.player-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.p-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.p-role-badge {
  font-size: 16px;
}

.p-info {
  display: flex;
  flex-direction: column;
}

.p-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.p-name {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.p-realm {
  font-size: 11px;
  color: var(--text-dim);
}

.p-spec {
  font-size: 11px;
  color: var(--text-muted);
}

.p-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.p-metric-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Terminal Feed */
.right-terminal {
  background: var(--bg-terminal);
}

.terminal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auto-scroll-toggle {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-micro:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.terminal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.log-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-break: break-all;
  line-height: 1.5;
}

.log-ts {
  color: var(--text-dim);
  flex-shrink: 0;
}

.log-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tag-info { background: rgba(56, 189, 248, 0.15); color: var(--cyan); }
.tag-success { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.tag-warn { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.tag-error { background: rgba(244, 63, 94, 0.15); color: var(--rose); }

.log-msg {
  color: #cbd5e1;
}

/* --------------------------------------------------------------------------
   TAB 2: PLAYER DATABASE & EXPLORER
   -------------------------------------------------------------------------- */
.database-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - 165px);
}

.db-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.database-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-subtle);
}

.db-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.db-filter-item.search-box {
  flex: 1.8;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.input-text, .input-select {
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  padding: 0 10px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  transition: border-color 0.15s;
}

.input-text:focus, .input-select:focus {
  outline: none;
  border-color: var(--cyan);
}

.database-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}

.db-table th {
  background: #111622;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
  font-family: var(--font-heading);
  text-align: center;
}

.db-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
  text-align: center;
}

.db-table th:first-child,
.db-table td:first-child {
  text-align: left;
}

.table-realm-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-brand-action {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-brand-action img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.btn-brand-action.action-rio {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.btn-brand-action.action-rio:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px) scale(1.08);
}

.btn-brand-action.action-rio img {
  border-radius: 50%;
}

.btn-brand-action.action-wcl {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.btn-brand-action.action-wcl:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px) scale(1.08);
}

.db-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.db-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-sub);
  margin-top: auto;
  flex-shrink: 0;
}

.db-page-info {
  font-size: 11px;
  color: var(--text-dim);
}

.db-pagination-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-num-display {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   TAB 3: ANALYTICS & REGIONS
   -------------------------------------------------------------------------- */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}

.region-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
}

.region-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.reg-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  justify-content: space-between;
}

.reg-count {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--cyan);
}

.pipeline-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 16px;
  gap: 8px;
}

.diagram-step {
  flex: 1;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cyan);
  color: #000;
  font-weight: 800;
  margin: 0 auto 4px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.step-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.step-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.diagram-arrow {
  color: var(--text-dim);
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   TAB 4: SETTINGS
   -------------------------------------------------------------------------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-group.full-width {
  grid-column: 1 / -1;
}

.setting-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.setting-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.input-with-action {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.input-with-action input {
  flex: 1;
  min-width: 120px;
}

.input-with-action .btn {
  height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
}

.vault-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--emerald);
  font-family: var(--font-mono);
}

.vault-indicator.syncing {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--cyan);
}

.vault-indicator.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--rose);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  animation: pulseDot 2s infinite;
}

.vault-indicator.syncing .pulse-dot {
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.vault-indicator.error .pulse-dot {
  background: var(--rose);
  box-shadow: 0 0 6px var(--rose);
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-cyan {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--cyan);
  cursor: pointer;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-cyan:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.btn-rose {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--rose);
  cursor: pointer;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-rose:hover {
  background: rgba(244, 63, 94, 0.25);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
  transform: translateY(-1px);
}

.btn-save {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 6px 16px;
}

.feedback-success {
  color: var(--emerald) !important;
  font-weight: 600;
}

.feedback-error {
  color: var(--rose) !important;
  font-weight: 600;
}

.scheduler-box {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
}

.scheduler-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scheduler-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.scheduler-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-medium);
  transition: 0.2s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--emerald);
}

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

/* --------------------------------------------------------------------------
   FOOTER STATUS BAR
   -------------------------------------------------------------------------- */
.studio-footer {
  height: 36px;
  background: var(--bg-header);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.running {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.footer-status-text {
  font-weight: 700;
  color: var(--emerald);
  letter-spacing: 0.3px;
  font-family: var(--font-heading);
}

.footer-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  margin: 0 2px;
}

.footer-sub {
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-meta {
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   USER SESSION BAR (Header Profile Capsule - Minia Theme)
   -------------------------------------------------------------------------- */
.user-session-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #141a26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  height: 38px;
  padding: 0 8px 0 10px;
  border-radius: 8px;
  margin-left: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-session-bar:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.user-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.user-email-display {
  font-size: 12px;
  font-weight: 700;
  color: #f3f4f6;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #f87171;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-logout i {
  font-size: 13px;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

/* --------------------------------------------------------------------------
   LOGIN & ACCESS GATE OVERLAY
   -------------------------------------------------------------------------- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 420px;
  max-width: 90vw;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(11, 15, 23, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(2, 132, 199, 0.15);
  padding: 28px 24px;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-crest-wrap {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px auto;
  border-radius: 12px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.login-crest {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.login-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.login-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 18px;
}

.login-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.login-tab.active {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-medium);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  color: var(--text-dim);
  pointer-events: none;
}

.login-input {
  width: 100%;
  height: 40px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0 12px 0 36px;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-ui);
  transition: all 0.15s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.field-hint {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-login {
  height: 42px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.4);
}

.btn-login:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.login-error-banner {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--rose);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  text-align: center;
}

.login-footer {
  margin-top: 18px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.vault-secured-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==========================================================================
   POPULATION PRIORITY TIERS & STRATEGY CARDS
   ========================================================================== */

.priority-tier-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.tier-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
}

.pill-p1 {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.pill-p2 {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.pill-p3 {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tier-pill-micro {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 14px;
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
}

.pill-p1-micro {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.pill-p2-micro {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.pill-p3-micro {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.table-realm-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-header-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.setting-badge-source {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.priority-strategy-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.strategy-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.strategy-card:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(56, 189, 248, 0.4);
}

.strategy-card input[type="radio"] {
  margin-top: 3px;
  accent-color: #0284c7;
  cursor: pointer;
}

.strategy-card:has(input[type="radio"]:checked) {
  background: rgba(14, 165, 233, 0.1);
  border-color: #0284c7;
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.2);
}

.strat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #fff;
}

.strat-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-p1 {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-turbo {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.badge-core {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.strat-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.region-card.active-region {
  border-color: #0284c7 !important;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.3) !important;
  background: rgba(14, 165, 233, 0.08) !important;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.reg-p1-tag {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.reg-p2-tag {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.reg-p3-tag {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.reg-harvest-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.reg-harvest-badge .badge-brand-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.reg-harvest-badge .badge-brand-icon.rio-icon {
  border-radius: 50%;
}

.reg-harvest-badge.badge-harvested {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.reg-harvest-badge.badge-unharvested {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.reg-breakdown-bar {
  display: flex;
  height: 5px;
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 6px;
  gap: 1px;
}

.bar-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.bar-seg.seg-p1 {
  background: #f59e0b;
}

.bar-seg.seg-p2 {
  background: #0ea5e9;
}

.bar-seg.seg-p3 {
  background: #64748b;
}

/* Brand Logos (Raider.IO & Warcraft Logs) */
.btn-brand-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
  flex-shrink: 0;
}

.pill-brand-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

.tier-brand-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 5px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   ANALYTICS TAB ENHANCEMENTS (Telemetry Matrix & Role Metrics)
   -------------------------------------------------------------------------- */
.analytics-matrix-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.analytics-matrix-table td {
  padding: 12px 14px;
  font-size: 12px;
}

.analytics-matrix-table tfoot td {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
  border-top: 2px solid var(--border-medium);
  padding: 12px 14px;
}

.matrix-region-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.matrix-region-tag {
  width: 38px;
  min-width: 38px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  border-radius: 4px;
  font-family: var(--font-number);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.matrix-region-tag.tag-us {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.matrix-region-tag.tag-eu {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.matrix-region-tag.tag-kr {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
}

.matrix-region-tag.tag-tw {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.matrix-region-tag.tag-all {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}

.matrix-region-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.matrix-region-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.matrix-region-name {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.matrix-region-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.matrix-dcs-label {
  color: #94a3b8;
}

.matrix-meta-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 9px;
}

.matrix-jur-list {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.matrix-jur-pill {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-number);
  letter-spacing: 0.3px;
  padding: 0 4px;
  height: 14px;
  line-height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
}

.reg-card-jur {
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.matrix-progress-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.matrix-progress-bar {
  background: rgba(255, 255, 255, 0.06);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.matrix-bar-fill-rio {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  height: 100%;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.matrix-bar-fill-wcl {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  height: 100%;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.role-metric-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.role-metric-kpi-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.role-metric-kpi-card:hover {
  border-color: var(--border-medium);
}

.role-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
}

.role-kpi-count {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  margin-top: 2px;
}

.role-kpi-top-player {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
  margin-top: 4px;
}

.pipeline-status-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.pipeline-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-card-sub);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  font-size: 11px;
}

.pipeline-stat-label {
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pipeline-stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
}


