@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&family=Orbitron:wght@700;900&display=swap');

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0c0a08;
  --bg-panel: #161210;
  --bg-input: #1e1a16;
  --bg-table-header: #1a1612;
  --bg-table-row: #161210;
  --bg-table-row-alt: #1a1714;
  --bg-hover: #252018;
  --text: #c8bfb0;
  --text-muted: #7a7060;
  --text-heading: #e8dcc8;
  --accent: #D4A843;
  --accent-hover: #e8c060;
  --accent-dim: rgba(212,168,67,0.10);
  --accent-glow: rgba(212,168,67,0.25);
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --border: #2a2218;
  --border-subtle: #201a12;
  --border-glow: rgba(212,168,67,0.18);
  --shadow: rgba(0,0,0,0.6);
  --shadow-accent: rgba(212,168,67,0.18);
  --glow-sm: 0 0 8px rgba(212,168,67,0.12);
  --glow-md: 0 0 16px rgba(212,168,67,0.18);
  --glow-lg: 0 0 32px rgba(212,168,67,0.12);
  --radius: 4px;
  --radius-sm: 3px;
  --radius-lg: 6px;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-display: 'Orbitron', sans-serif;
}

body.light-mode {
  --bg: #f2efe8;
  --bg-panel: #fffdf8;
  --bg-input: #eae5da;
  --bg-table-header: #ede8de;
  --bg-table-row: #fffdf8;
  --bg-table-row-alt: #f7f4ed;
  --bg-hover: #e6e0d4;
  --text: #2a2218;
  --text-muted: #6b5f4e;
  --text-heading: #1a1408;
  --accent: #a07820;
  --accent-hover: #8a6818;
  --accent-dim: rgba(160,120,32,0.08);
  --accent-glow: rgba(160,120,32,0.10);
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --border: #d4cbb8;
  --border-subtle: #dfd8c8;
  --border-glow: rgba(160,120,32,0.10);
  --shadow: rgba(0,0,0,0.06);
  --shadow-accent: rgba(160,120,32,0.08);
  --glow-sm: none;
  --glow-md: none;
  --glow-lg: none;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Global focus states for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible {
  outline: none; /* these use their own border/shadow focus style */
}

/* === Top Bar === */
.topbar {
  background: transparent;
  border-bottom: none;
  padding: 0 24px;
  height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 100;
}

.topbar-left { display: none; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.logo {
  font-size: 1.2rem;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(212,168,67,0.08);
  transition: text-shadow 0.3s;
}
.logo:hover {
  text-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(212,168,67,0.15);
}
.logo-sub { font-size: 0.8rem; color: var(--text-muted); }

.btn-icon {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  text-decoration: none;
  backdrop-filter: blur(8px);
}
.btn-icon:hover { background: var(--bg-panel); border-color: var(--accent); color: var(--accent); }
body.light-mode .btn-icon { background: rgba(255,255,255,0.6); }

/* Settings Dropdown */
.settings-dropdown-wrapper {
  position: relative;
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px var(--shadow), 0 0 0 1px var(--border);
  padding: 12px 16px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-dropdown.hidden { display: none; }

.settings-dropdown-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.settings-dropdown .setting-item {
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 3px 0;
}

/* Dashboard Tabs */
.dash-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.dash-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.dash-tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.dash-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.dash-tab-panel { display: none; }
.dash-tab-panel.active { display: block; }

.cache-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* === Views === */
.view { display: none; max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.view.active { display: block; }

/* === Setup View === */
.setup-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  margin: 40px auto;
  box-shadow: 0 4px 24px var(--shadow), var(--glow-lg);
}

.setup-card h2 {
  color: var(--text-heading);
  margin-bottom: 24px;
  font-size: 1.3rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

input, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.settings-panel {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.settings-panel summary {
  padding: 12px 16px;
  background: var(--bg-input);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.settings-panel summary:hover { color: var(--text); }
.settings-grid {
  padding: 16px;
  display: grid;
  gap: 10px;
}
.setting-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.setting-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* === Buttons === */
.btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary { box-shadow: var(--glow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: var(--glow-md), 0 4px 16px var(--shadow-accent); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--accent-dim); }

.btn-sm { padding: 5px 10px; font-size: 0.72rem; }
.btn-lg { padding: 12px 32px; font-size: 1rem; width: 100%; }

/* === Dashboard View === */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}
.dashboard-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(212,168,67,0.08);
  margin-bottom: 4px;
  cursor: pointer;
}
body.light-mode .dashboard-logo { text-shadow: none; }
.dashboard-header h2 {
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 600;
}
.dashboard-actions { display: flex; gap: 8px; }

.raid-section { margin-bottom: 32px; }
.row-missing { opacity: 0.5; cursor: default !important; }
.row-missing:hover { background: inherit !important; }
.row-missing.row-tmb { opacity: 0.7; }
.row-missing.row-tmb td { font-style: italic; }
.raid-days-row { display: flex; gap: 24px; }
@media (max-width: 900px) { .raid-days-row { flex-direction: column; } }

/* === Raid Cards === */
.raid-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--glow-sm);
  transition: box-shadow 0.3s;
  flex: 1;
  min-width: 0;
}

.raid-card-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-heading);
  background: linear-gradient(135deg, rgba(212,168,67,0.08) 0%, var(--bg-panel) 100%);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.raid-card-icon {
  font-size: 1rem;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.raid-card-body {
  padding: 0;
}

/* Remove table border/shadow when inside a raid card */
.raid-card .report-list-table {
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

/* Light mode: no glow gradient, simple bg */
body.light-mode .raid-card-header {
  background: var(--bg-table-header);
  box-shadow: none;
}
.section-title {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  text-shadow: 0 0 12px rgba(212,168,67,0.1);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.report-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid var(--border);
  position: relative;
}
.report-card:hover {
  background: var(--bg-hover);
  border-left-color: var(--accent);
  box-shadow: var(--glow-md), 0 4px 20px var(--shadow);
  transform: translateY(-1px);
}

.report-card .zone-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.report-card .report-card-title {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.95rem;
  margin-top: 8px;
}

.report-card .report-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 12px;
}

.report-card .report-card-owner {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Report List Table (Dashboard) === */
.report-list-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--glow-sm);
}
.report-list-table th {
  background: var(--bg-table-header);
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
}
.report-list-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.report-list-table tr.report-row {
  cursor: pointer;
  transition: background 0.15s;
}
.report-list-table tr.report-row:hover {
  background: var(--bg-hover);
  box-shadow: inset 3px 0 0 var(--zone-color, var(--accent));
}
.report-list-table tr.report-row:nth-child(even) td {
  background: var(--bg-table-row-alt);
}
.report-list-table tr.report-row:nth-child(even):hover td {
  background: var(--bg-hover);
}

.badge-kill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(52,211,153,0.12);
  color: var(--success);
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(52,211,153,0.3);
}
.badge-wipe {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(248,113,113,0.12);
  color: var(--error);
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(248,113,113,0.3);
}

.zone-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 6px;
}

/* === Analysis View === */
.analysis-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.report-info-bar {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text);
}
.report-info-bar strong { color: var(--text-heading); }

/* === Tabs === */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--bg-hover); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-dim); box-shadow: 0 2px 12px var(--accent-glow); }

.tab-panels {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 300px;
  box-shadow: var(--glow-sm);
}

.tab-panel { display: none; padding: 20px; }
.tab-panel.active { display: block; }

.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.select-fight {
  min-width: 240px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.inline-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* === Status Bar === */
.status-bar {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 16px;
  background: var(--bg-input);
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  box-shadow: -3px 0 12px var(--accent-glow);
}
.status-bar.status-error { background: rgba(239,68,68,0.12); color: var(--error); }

/* === Tables === */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.results-table thead th {
  background: var(--bg-table-header);
  color: var(--text-muted);
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
  position: sticky;
  top: 0;
  white-space: nowrap;
}

.results-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.results-table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
.results-table tbody tr:hover { background: var(--bg-hover); }

/* Buff table expand/collapse */
.buff-summary-row.expandable { cursor: pointer; }
.expand-arrow { display: inline-block; font-size: 0.65rem; width: 1em; transition: transform 0.15s; color: var(--text-muted); }
.buff-detail-row td { padding: 2px 8px; font-size: 0.8rem; border-top: none; }
.buff-detail-row { background: var(--bg-panel) !important; }
.buff-detail-row:hover { background: var(--bg-hover) !important; }
.pet-scroll-inline { font-size: 0.75rem; }
.detail-fight-name { white-space: nowrap; }
.buff-ok { color: var(--success); }
.buff-partial { color: var(--warning); }
.buff-miss { color: var(--error); opacity: 0.8; }
.avoid-resisted { color: var(--success); font-weight: 600; cursor: help; }
body.light-mode .buff-miss { opacity: 1; }

/* Percentage coloring */
.pct-100 { color: var(--success); font-weight: 600; }
.pct-high { color: #4ade80; font-weight: 600; }
body.light-mode .pct-high { color: #16a34a; }
.pct-mid { color: var(--warning); font-weight: 600; }
.pct-low { color: var(--error); font-weight: 600; }

/* Class colors — dark mode */
.class-warrior { color: #C79C6E; }
.class-paladin { color: #F58CBA; }
.class-hunter { color: #ABD473; }
.class-rogue { color: #FFF569; }
.class-priest { color: #e0e0e0; }
.class-shaman { color: #0070DE; }
.class-mage { color: #69CCF0; }
.class-warlock { color: #9482C9; }

/* Class colors — light mode (darker for readability) */
body.light-mode .class-warrior { color: #96642a; }
body.light-mode .class-paladin { color: #c4498a; }
body.light-mode .class-hunter { color: #5a8a1e; }
body.light-mode .class-rogue { color: #9e9600; }
body.light-mode .class-priest { color: #555; }
body.light-mode .class-shaman { color: #0058b0; }
body.light-mode .class-mage { color: #1a8fb8; }
body.light-mode .class-warlock { color: #6a54a4; }
.class-druid { color: #FF7D0A; }
.class-death-knight { color: #C41E3A; }
body.light-mode .class-druid { color: #b85a00; }
body.light-mode .class-death-knight { color: #a01a30; }

/* === Tags === */
.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-success { background: rgba(52,211,153,0.12); color: var(--success); text-shadow: 0 0 8px rgba(52,211,153,0.3); }
.tag-danger { background: rgba(248,113,113,0.12); color: var(--error); text-shadow: 0 0 8px rgba(248,113,113,0.3); }
.tag-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.tag-info { background: var(--accent-dim); color: var(--accent); }

/* === Player Cards (Gear) === */
.player-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.player-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.issues-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.issues-table th {
  padding: 6px 10px;
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.issues-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

/* === Gear Summary === */
.gear-summary {
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--bg-table-header);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* === Wowhead Item Links === */
.issues-table a[data-wowhead] {
  color: #a335ee; /* epic purple default */
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.issues-table a[data-wowhead]:hover {
  color: #c980ff;
  text-decoration: underline;
}
.gem-link {
  font-size: 0.75rem;
  color: var(--text-muted) !important;
  margin-left: 4px;
}

/* === Loading Overlay === */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  gap: 16px;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay p {
  color: #fff;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* === Utility === */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }

.penalty-card__status {
  padding: 8px 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.penalty-card__status:empty { display: none; }

/* === Custom Modal === */
.cla-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.15s ease-out;
}
.cla-modal-overlay.hidden { display: none; }
.cla-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  min-width: 340px;
  max-width: 440px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6), var(--glow-lg);
  animation: modal-slide-in 0.2s ease-out;
}
.cla-modal__title {
  padding: 16px 20px 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
}
.cla-modal__body {
  padding: 0 20px 16px;
  font-size: 0.85rem;
  color: var(--text);
}
.cla-modal__body input {
  margin-top: 8px;
  width: 100%;
}
.cla-modal__body .modal-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.cla-modal__body .modal-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 6px;
}
.cla-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-table-header);
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-slide-in { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

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

/* === Section Header Row === */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.section-header-row .section-title { margin-bottom: 0; }

/* === Progression Table === */
.progression-wrapper {
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) var(--bg-panel);
}
.progression-wrapper::-webkit-scrollbar { height: 8px; }
.progression-wrapper::-webkit-scrollbar-track { background: var(--bg-panel); }
.progression-wrapper::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
.progression-wrapper::-webkit-scrollbar-thumb:hover { background: var(--text-heading); }

.progression-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}

.progression-table thead {
  z-index: 2;
}

.progression-table th {
  padding: 8px 6px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-table-header);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 4px var(--accent-glow);
}

.progression-table th.col-player,
.progression-table td.col-player {
  text-align: left;
  padding-left: 12px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-panel);
  font-weight: 600;
  min-width: 120px;
}

.progression-table thead th.col-player {
  background: var(--bg-table-header);
  z-index: 3;
}

.progression-table th.col-attend,
.progression-table td.col-attend {
  min-width: 60px;
  text-align: center;
}

.progression-table th.col-trend,
.progression-table td.col-trend {
  min-width: 36px;
  text-align: center;
}

.progression-table td {
  padding: 6px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  min-width: 44px;
}

/* Raid column header */
.raid-col-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}

.zone-badge-sm {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.raid-date { font-size: 0.65rem; color: var(--text-muted); }
.raid-links { font-size: 0.6rem; }
.raid-date-link { color: var(--text-muted); opacity: 0.7; text-decoration: none; }
.raid-date-link:hover { opacity: 1; text-decoration: underline; }
.raid-kills { font-size: 0.6rem; color: var(--text-muted); opacity: 0.7; }

/* Class separator */
.class-separator td {
  padding: 6px 12px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-table-header);
}

/* Cells */
.cell-absent {
  color: var(--text-muted);
  opacity: 0.35;
}

.cell-tmb-present {
  background: rgba(76, 175, 80, 0.18) !important;
  color: #4caf50;
  font-weight: 700;
}
.cell-bench {
  background: rgba(100, 181, 246, 0.18) !important;
  color: #64b5f6;
  font-weight: 700;
}
.bench-count {
  color: #64b5f6;
  font-weight: 600;
}
/* moved below cell-ok/warn/bad for specificity */
.penalty-badge {
  color: #ef5350;
  font-weight: 700;
}
.excused-badge {
  color: #66bb6a;
  font-weight: 600;
}
.col-tmb .raid-col-header { opacity: 0.6; }

/* Week grouping header */
.col-week-spacer {
  background: transparent !important;
  border-bottom: none !important;
}
.col-week {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 6px !important;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
}
.dark-mode .week-even { background: rgba(255,255,255,0.03); }
.dark-mode .week-odd { background: rgba(255,255,255,0.07); }
body.light-mode .week-even { background: rgba(0,0,0,0.02); }
body.light-mode .week-odd { background: rgba(0,0,0,0.05); }

/* Week separator: thick left border on first column of each week */
.dark-mode .week-start { border-left: 3px solid rgba(255,255,255,0.25) !important; }
body.light-mode .week-start { border-left: 3px solid rgba(0,0,0,0.2) !important; }

/* Day of week coloring: Thursday = warm, Tuesday = cool */
.raid-day-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.col-thu .raid-day-label { color: #e8a735; }
.col-tue .raid-day-label { color: #5b9bd5; }
.dark-mode th.col-thu { border-left: 2px solid rgba(232,167,53,0.4); background: rgba(232,167,53,0.08); }
.dark-mode th.col-tue { border-left: 2px solid rgba(91,155,213,0.4); background: rgba(91,155,213,0.08); }
.dark-mode td.col-thu { border-left: 2px solid rgba(232,167,53,0.2); background: rgba(232,167,53,0.04); }
.dark-mode td.col-tue { border-left: 2px solid rgba(91,155,213,0.2); background: rgba(91,155,213,0.04); }
body.light-mode th.col-thu { border-left: 2px solid rgba(232,167,53,0.5); background: rgba(232,167,53,0.1); }
body.light-mode th.col-tue { border-left: 2px solid rgba(91,155,213,0.5); background: rgba(91,155,213,0.1); }
body.light-mode td.col-thu { border-left: 2px solid rgba(232,167,53,0.25); background: rgba(232,167,53,0.05); }
body.light-mode td.col-tue { border-left: 2px solid rgba(91,155,213,0.25); background: rgba(91,155,213,0.05); }

/* Progression day filter */
.progression-filters {
  display: flex;
  gap: 12px;
  margin: 8px 0;
}
.day-label-thu { color: #e8a735; font-weight: 700; }
.day-label-tue { color: #5b9bd5; font-weight: 700; }

.cell-ok {
  background: rgba(76, 175, 80, 0.18) !important;
  color: #4caf50;
  font-weight: 700;
}

.cell-warn {
  background: rgba(255, 193, 7, 0.18) !important;
  color: #ffc107;
  font-weight: 700;
}

.cell-bad {
  background: rgba(244, 67, 54, 0.15) !important;
  color: #f44336;
  font-weight: 700;
}
td.cell-revoked, td.cell-revoked.cell-ok, td.cell-revoked.cell-warn, td.cell-revoked.cell-bad {
  background: rgba(239, 83, 80, 0.25) !important;
  outline: 2px solid rgba(239, 83, 80, 0.5);
  outline-offset: -2px;
}

/* Light-mode cell colors (darker for readability on white bg) */
body.light-mode .cell-ok { color: #1b8a2a; }
body.light-mode .cell-warn { color: #b8860b; }
body.light-mode .cell-bad { color: #c0392b; }
body.light-mode .attend-high { color: #1b8a2a; }
body.light-mode .attend-mid { color: #b8860b; }
body.light-mode .attend-low { color: #c0392b; }
body.light-mode .trend-up { color: #1b8a2a; }
body.light-mode .trend-down { color: #c0392b; }
body.light-mode .dot-green { background: #1b8a2a; }
body.light-mode .dot-yellow { background: #b8860b; }
body.light-mode .dot-red { background: #c0392b; }
body.light-mode .cell-ok-demo { color: #1b8a2a; }
body.light-mode .cell-warn-demo { color: #b8860b; }
body.light-mode .cell-bad-demo { color: #c0392b; }
body.light-mode .day-label-thu { color: #a07020; }
body.light-mode .day-label-tue { color: #2a6fa0; }

/* Light-mode: topbar, panels, loot, badges */
body.light-mode .topbar { box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
body.light-mode .col-loot:not(.text-muted) { color: #9e7c00; }
body.light-mode .loot-os { color: #607d8b; }
body.light-mode .bench-count { color: #2a6fa0; }
body.light-mode .cell-bench { background: rgba(42,111,160,0.1) !important; color: #2a6fa0; }
body.light-mode .cell-tmb-present { background: rgba(27,138,42,0.1) !important; color: #1b8a2a; }
body.light-mode .penalty-badge { color: #c0392b; }
body.light-mode .excused-badge { color: #1b8a2a; }
body.light-mode .merge-toggle { color: #607d8b; }
body.light-mode .merge-alt-count { color: #607d8b; }

/* Light-mode: tables need visible borders and proper backgrounds */
body.light-mode .results-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
body.light-mode .results-table thead th { background: var(--bg-table-header); color: #3a4050; border-bottom: 2px solid var(--border); }
body.light-mode .results-table tbody td { border-bottom-color: var(--border-subtle); }
body.light-mode .report-list-table { border: 1px solid var(--border); }
body.light-mode .report-list-table th { background: var(--bg-table-header); color: #3a4050; }
body.light-mode .status-bar { background: var(--bg-input); border-left-color: var(--accent); }
body.light-mode .gear-summary { background: var(--bg-input); }
body.light-mode .player-card { background: var(--bg-table-row-alt); }
body.light-mode .live-fight-card { background: var(--bg-panel); border-color: var(--border); }
body.light-mode .live-fight-card.latest { border-color: var(--accent); box-shadow: 0 0 12px var(--shadow-accent); }

/* Light-mode: wowhead item links */
body.light-mode .issues-table a[data-wowhead] { color: #7e22ce; }
body.light-mode .issues-table a[data-wowhead]:hover { color: #6b21a8; }
body.light-mode .pd-gear-change a { color: #7e22ce; }
body.light-mode .pd-gear-change a:hover { color: #6b21a8; }

/* Light-mode: bug tracker badges */
body.light-mode .badge-open { color: #92700c; border-color: rgba(146,112,12,0.3); }
body.light-mode .badge-closed { color: #16a34a; border-color: rgba(22,163,74,0.3); }
body.light-mode .badge-wontfix { color: #6b7280; border-color: rgba(107,114,128,0.3); }

/* Light-mode: role badges */
body.light-mode .role-tank { color: #2563eb; background: rgba(37,99,235,0.1); }
body.light-mode .role-heal { color: #16a34a; background: rgba(22,163,74,0.1); }
body.light-mode .role-dd { color: #dc2626; background: rgba(220,38,38,0.08); }

/* Attendance colors */
.attend-high { color: #4caf50; font-weight: 600; }
.attend-mid { color: #ffc107; font-weight: 600; }
.attend-low { color: #f44336; font-weight: 600; }

.attend-count {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Trend arrows */
.trend-up { color: #4caf50; font-size: 0.85rem; }
.trend-down { color: #f44336; font-size: 0.85rem; }
.trend-stable { color: var(--text-muted); font-size: 0.85rem; }

/* Cell content with gear + dots */
.cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
}

.cell-gear { font-size: 0.8rem; }

.cell-dots {
  display: flex;
  gap: 2px;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-green { background: #4caf50; }
.dot-yellow { background: #ffc107; }
.dot-red { background: #f44336; }
.dot-blue { background: #2196F3; }
.dot-orange { background: #FF9800; }
.dot-purple { background: #AB47BC; }
.dot-legend { background: #888; }

/* Legend */
.progression-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-sep { color: var(--border); }

.cell-ok-demo { color: #4caf50; font-weight: 700; }
.cell-warn-demo { color: #ffc107; font-weight: 700; }
.cell-bad-demo { color: #f44336; font-weight: 700; }
.cell-absent-demo { color: var(--text-muted); opacity: 0.5; }

/* Consumable average column */
.col-consavg { min-width: 50px; text-align: center; }
.col-loot {
  min-width: 45px;
  text-align: center;
  cursor: default;
  white-space: nowrap;
}
.col-loot:not(.text-muted) {
  color: #ffd54f;
  font-weight: 700;
}
.loot-os {
  color: #90a4ae;
  font-weight: 600;
}

/* Merge alts styles */
.merge-parent { cursor: pointer; }
.merge-toggle {
  display: inline-block;
  width: 14px;
  font-size: 0.7em;
  color: #90a4ae;
  transition: transform 0.15s;
  vertical-align: middle;
}
.merge-expanded .merge-toggle { color: var(--text-heading); }
.merge-alt-count { color: #90a4ae; font-weight: 400; }
.merge-indent { padding-left: 22px !important; }
.merge-child td { opacity: 0.75; font-size: 0.92em; }
.merge-child td.col-player { font-style: italic; }

/* Hover on progression rows */
.progression-table tbody tr:not(.class-separator):hover td {
  background: var(--bg-hover);
}
.progression-table tbody tr:not(.class-separator):hover td.col-player {
  background: var(--bg-hover);
}

/* === Statistik Tab === */
.stats-section {
  margin-bottom: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--glow-sm);
}
.stats-subtitle {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Achievement cards */
.achieve-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.achieve-card { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--bg-panel); border: 1px solid var(--border); transition: border-color 0.2s; }
.achieve-card:hover { border-color: var(--success); }
.achieve-negative:hover { border-color: var(--error); }
.achieve-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.achieve-body { min-width: 0; }
.achieve-title { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.achieve-desc { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.achieve-holders { font-size: 0.85rem; }
.achieve-detail { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.stats-table { width: 100%; max-width: 900px; }
.stats-table th { text-align: left; }
.stats-table tbody td { font-family: var(--font-mono); font-size: 0.82rem; }
.stats-table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
.stats-table tbody tr:hover { background: var(--bg-hover); }
.sortable-th { cursor: pointer; user-select: none; position: relative; padding-right: 18px !important; }
.sortable-th:hover { color: var(--accent); }
.sortable-th::after { content: '\21C5'; position: absolute; right: 4px; opacity: 0.3; font-size: 0.8em; }
.sortable-th.sort-asc::after { content: '\25B2'; opacity: 0.8; }
.sortable-th.sort-desc::after { content: '\25BC'; opacity: 0.8; }
.stats-medal-1 { color: #ffd700; font-weight: bold; }
.stats-medal-2 { color: #c0c0c0; font-weight: bold; }
.stats-medal-3 { color: #cd7f32; font-weight: bold; }
body.light-mode .stats-medal-1 { color: #b8960a; }
body.light-mode .stats-medal-2 { color: #777; }
body.light-mode .stats-medal-3 { color: #8a5520; }
.stats-expand-btn { margin-top: 0.5rem; margin-bottom: 1rem; }

/* === Responsive === */
/* Wackelnera Easter Egg */
.wackelnera {
  display: inline-block;
  cursor: pointer;
  transition: color 0.2s;
}
.wackelnera:hover {
  animation: wackel 0.3s ease-in-out infinite;
  color: #f59e0b;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}
@keyframes wackel {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg) scale(1.05); }
  40% { transform: rotate(6deg) scale(1.1); }
  60% { transform: rotate(-4deg) scale(1.05); }
  80% { transform: rotate(3deg); }
}

/* Alirya No Glaives Easter Egg */
.alirya-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.no-glaives-popup {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ef4444;
  text-shadow: 0 0 8px rgba(239,68,68,0.6);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: none;
}
.alirya-wrapper:hover .no-glaives-popup {
  animation: glaives-shatter 1.2s ease-out forwards;
}
.alirya-wrapper:hover .alirya-name {
  animation: alirya-shake 0.4s ease-in-out;
}
@keyframes glaives-shatter {
  0% {
    opacity: 1;
    top: -4px;
    transform: translateX(-50%) scale(1) rotate(0deg);
    filter: blur(0);
  }
  30% {
    opacity: 1;
    top: -14px;
    transform: translateX(-50%) scale(1.2) rotate(-2deg);
  }
  60% {
    opacity: 0.7;
    top: 8px;
    transform: translateX(-45%) scale(0.9) rotate(3deg);
    filter: blur(0.5px);
  }
  100% {
    opacity: 0;
    top: 28px;
    transform: translateX(-40%) scale(0.5) rotate(8deg);
    filter: blur(3px);
  }
}
@keyframes alirya-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-3px); }
  30% { transform: translateX(3px); }
  45% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

/* Nofax Kirby Easter Egg */
.nofax-wrapper { display: inline-block; cursor: pointer; position: relative; }
.nofax-kirby {
  position: absolute;
  right: -52px;
  top: -16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 50;
}
.kirby-gif {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 6px rgba(255,105,180,0.5));
}

.nofax-loot {
  position: absolute;
  right: -90px;
  top: -6px;
  font-size: 1.1em;
  color: #a335ee;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(163,53,238,0.6);
  z-index: 49;
}
.nofax-loot2 { animation-delay: 0.4s !important; right: -100px; top: 0px; color: #0070dd; text-shadow: 0 0 8px rgba(0,112,221,0.6); font-size: 0.9em; }
.nofax-loot3 { animation-delay: 0.8s !important; right: -95px; top: -12px; color: #1eff00; font-size: 0.8em; text-shadow: 0 0 6px rgba(30,255,0,0.4); }

.nofax-wrapper:hover .nofax-kirby {
  opacity: 1;
  animation: nofax-bounce 0.5s ease-in-out infinite alternate;
}
.nofax-wrapper:hover .nofax-loot {
  opacity: 1;
  animation: nofax-suck 0.8s ease-in infinite;
}
.nofax-wrapper:hover .nofax-name {
  animation: nofax-shake 0.3s ease-in-out;
}
@keyframes nofax-bounce {
  from { transform: translateY(0) rotate(-5deg); }
  to { transform: translateY(-4px) rotate(5deg); }
}
@keyframes nofax-suck {
  0% { opacity: 1; transform: scale(1) rotate(0deg) translateX(0); }
  50% { opacity: 0.7; transform: scale(0.6) rotate(200deg) translateX(40px); }
  100% { opacity: 0; transform: scale(0) rotate(400deg) translateX(55px); }
}
@keyframes nofax-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Lyserie Easter Egg */
.lyserie-wrapper { display: inline-block; cursor: pointer; position: relative; }
.lyserie-wrapper:hover span {
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.05em;
  animation: lyserie-yawn 2s ease-in-out infinite;
}
.lyserie-wrapper::after {
  content: 'zzZ';
  position: absolute;
  right: -22px;
  top: -2px;
  font-size: 0.55em;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  letter-spacing: 0.05em;
}
.lyserie-wrapper:hover::after {
  animation: lyserie-zzz 1.5s ease-out infinite;
}
@keyframes lyserie-yawn {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(1px) rotate(1deg); }
  60% { transform: translateY(-1px) rotate(-1deg); }
}
@keyframes lyserie-zzz {
  0% { opacity: 1; right: -22px; top: -2px; }
  50% { opacity: 0.8; right: -28px; top: -10px; }
  100% { opacity: 0; right: -34px; top: -18px; }
}

/* Nisali Easter Egg */
.nisali-wrapper { display: inline-block; cursor: pointer; }
.nisali-a { display: none; }
.nisali-wrapper:hover .nisali-i { display: none; }
.nisali-wrapper:hover .nisali-a { display: inline; }

/* Live Ticker Tab */
.live-dot-tab {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6); }
  50% { opacity: 0.6; box-shadow: 0 0 10px 5px rgba(248, 113, 113, 0.25); }
}
.live-ticker {
  padding: 0;
}
.live-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.live-header-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
}
.live-header-meta {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.live-status.active { background: rgba(239,68,68,0.12); color: var(--error); }
.live-status.ended { background: rgba(107,114,128,0.12); color: var(--text-muted); }
.live-fights-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.live-fight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-table-row);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.live-fight-row:nth-child(even) { background: var(--bg-table-row-alt); }
.live-fight-row.latest {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
  animation: live-fight-in 0.4s ease-out;
}
.live-fight-row .fight-num {
  color: var(--text-muted);
  font-size: 0.8rem;
  min-width: 24px;
}
.live-fight-row .fight-name { flex: 1; font-weight: 500; }
.live-fight-row .fight-result {
  font-weight: 700;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.live-fight-row .fight-result.kill { background: rgba(34,197,94,0.12); color: var(--success); }
.live-fight-row .fight-result.wipe { background: rgba(239,68,68,0.12); color: var(--error); }
.live-fight-row .fight-dur { color: var(--text-muted); font-size: 0.82rem; min-width: 50px; text-align: right; }
.live-fight-row .fight-time { color: var(--text-muted); font-size: 0.78rem; min-width: 50px; text-align: right; }
@keyframes live-fight-in {
  0% { transform: translateX(-10px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
.live-summary {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.live-summary span { font-weight: 600; color: var(--text); }
.live-fight-row .fight-expand-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 14px;
  transition: transform 0.2s;
}
.live-fight-detail {
  margin: 0 0 4px 0;
  padding: 0 8px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.live-detail-loading {
  padding: 10px 14px;
  font-size: 0.84rem;
}
.live-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 4px 0 8px 0;
}
.live-detail-table th {
  text-align: left;
  padding: 5px 10px;
  background: var(--bg-table-header);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}
.live-detail-table td {
  padding: 4px 10px;
  border-bottom: 1px solid var(--border);
}
.live-detail-table tr:last-child td { border-bottom: none; }
.live-detail-table .sev-high { color: var(--error); }
.live-detail-table .sev-medium { color: var(--warning); }
.live-detail-table .issue-cat { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.live-detail-summary {
  font-size: 0.82rem;
  color: var(--warning);
  padding: 4px 10px 6px;
  font-weight: 500;
}
.live-detail-ok {
  font-size: 0.82rem;
  color: var(--success);
  padding: 4px 10px 8px;
}
.live-gear-toggle {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  font-weight: 500;
  user-select: none;
}
.live-gear-toggle:hover { color: var(--text); }
.live-gear-detail { padding: 0 0 4px 0; }

/* New Live Ticker — Fight Cards */
.live-fight-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}
.live-fight-card.latest {
  border-color: var(--accent);
  box-shadow: var(--glow-md), 0 0 32px rgba(212,168,67,0.08);
  animation: live-fight-in 0.4s ease-out;
}
.live-fight-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.live-fight-header .fight-num { color: var(--text-muted); font-size: 0.8rem; min-width: 28px; }
.live-fight-header .fight-name { font-weight: 600; font-size: 1rem; flex: 1; }
.live-fight-header .fight-result { font-weight: 700; font-size: 0.7rem; padding: 2px 10px; border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: 0.04em; }
.live-fight-header .fight-result.kill { background: rgba(34,197,94,0.12); color: var(--success); }
.live-fight-header .fight-result.wipe { background: rgba(239,68,68,0.12); color: var(--error); }
.live-fight-header .fight-dur { color: var(--text-muted); font-size: 0.85rem; }
.live-fight-header .fight-time { color: var(--text-muted); font-size: 0.78rem; }
.live-fight-header .fight-players { color: var(--text-muted); font-size: 0.78rem; margin-left: auto; }

/* Live Slacker Section */
.live-slacker-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.live-slacker-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.live-slacker-title.sev-high { color: var(--error); }
.live-slacker-title.sev-medium { color: var(--warning); }
.live-slacker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.live-slacker-table th {
  text-align: left;
  padding: 5px 10px;
  background: var(--bg-table-header);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
}
.live-slacker-table td {
  padding: 4px 10px;
  border-bottom: 1px solid var(--border);
}
.live-slacker-table tr:last-child td { border-bottom: none; }

/* Live All OK / OK badge */
.live-all-ok {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
  padding: 8px 0;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}
.live-ok { color: var(--success); font-weight: 500; }

/* Live Filters */
.live-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

/* Live Analyzing Indicator */
.live-analyzing {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Live Gear Section (bottom, fight-independent) */
.live-gear-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}
.live-gear-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .view { padding: 16px; }
  .setup-card { padding: 20px; margin: 16px auto; }
  .form-row { flex-direction: column; }
  .report-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; gap: 12px; }
  .panel-actions { flex-direction: column; align-items: stretch; }
  .select-fight { min-width: 100%; }
}

/* ═══ PLAYER DETAIL PAGE ═══ */
.player-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.player-link { color: inherit; text-decoration: none; }
.player-link:hover { text-decoration: underline; color: var(--accent); }

.pd-name {
  font-size: 1.2rem;
  font-weight: 700;
}
.pd-class {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 12px;
  opacity: 0.7;
}
.pd-badges {
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pd-section {
  margin-bottom: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pd-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 16px;
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border);
}

/* Attendance grid */
.pd-attend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 12px 16px;
}
.pd-att-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  min-width: 48px;
  gap: 1px;
}
.pd-att-present { background: rgba(34,197,94,0.12); }
.pd-att-absent { background: rgba(107,114,128,0.08); }
.pd-att-revoked { background: rgba(239,68,68,0.15); }
.pd-att-excused { background: rgba(212,168,67,0.1); }
.pd-att-zone { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.pd-att-date { font-size: 0.62rem; color: var(--text-muted); }

/* Tables */
.pd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.pd-table thead th {
  padding: 8px 16px;
  text-align: left;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border);
}
.pd-table tbody td {
  padding: 7px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.pd-table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
.pd-table tbody tr:hover { background: var(--bg-hover); }

/* Deaths */
.pd-deaths {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
}
.pd-death-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  background: rgba(239,68,68,0.08);
  border-radius: var(--radius-sm);
}
.pd-death-date { font-size: 0.62rem; color: var(--text-muted); }
.pd-death-count { font-size: 0.82rem; font-weight: 700; color: var(--error); }

/* Gear changes */
.pd-gear-raid {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.pd-gear-raid:last-child { border-bottom: none; }
.pd-gear-date {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pd-gear-change {
  font-size: 0.8rem;
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pd-gear-slot {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  min-width: 90px;
}
.pd-gear-change a { color: #a335ee; }
.pd-gear-change a:hover { color: #c980ff; }

/* ═══ GIRLY MODE (Claudiamarie Easter Egg) ═══ */
.girly-bg {
  position: fixed; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.8s; pointer-events: none;
  background: radial-gradient(ellipse at 20% 50%, #ff9ed8 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, #ffc4e8 0%, transparent 40%), radial-gradient(ellipse at 50% 80%, #e8a0ff 0%, transparent 50%), linear-gradient(160deg, #ffb6d9 0%, #ffd4f1 25%, #f8c0ff 50%, #d4a0ff 75%, #ffb6d9 100%);
}
/* Emoji fallback: use inline SVG backgrounds instead of Unicode emojis */
.cloud {
  position: fixed; z-index: 0; opacity: 0; transition: opacity 0.8s; pointer-events: none;
  width: 120px; height: 40px; background: rgba(255,255,255,0.7); border-radius: 40px;
  box-shadow: 30px -15px 0 10px rgba(255,255,255,0.6), 60px -5px 0 15px rgba(255,255,255,0.5), -10px -10px 0 8px rgba(255,255,255,0.6);
}
.cloud-1 { top: 8%; left: -10%; animation: cloud-drift 25s linear infinite; }
.cloud-2 { top: 22%; left: -15%; animation: cloud-drift 35s linear infinite; animation-delay: -10s; font-size: 3rem; }
.cloud-3 { top: 45%; left: -12%; animation: cloud-drift 30s linear infinite; animation-delay: -20s; font-size: 5rem; }
.cloud-4 { top: 65%; left: -8%; animation: cloud-drift 22s linear infinite; animation-delay: -5s; font-size: 3.5rem; }
.cloud-5 { top: 80%; left: -14%; animation: cloud-drift 28s linear infinite; animation-delay: -15s; }
@keyframes cloud-drift { from { transform: translateX(-100px); } to { transform: translateX(calc(100vw + 200px)); } }

.unicorn {
  position: fixed; z-index: 1000; opacity: 0; transition: opacity 0.5s; pointer-events: none;
  width: 0; height: 0;
  border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 40px solid #ff69b4;
  filter: drop-shadow(0 0 8px rgba(255,105,180,0.6));
}
.unicorn::after {
  content: ''; position: absolute; top: 12px; left: -10px;
  width: 20px; height: 20px; background: #ff69b4; border-radius: 50%;
}
.unicorn-1 { top: 15%; animation: unicorn-fly 8s linear infinite; }
.unicorn-2 { top: 40%; animation: unicorn-fly 6s linear infinite; animation-delay: -2s; font-size: 4rem; }
.unicorn-3 { top: 70%; animation: unicorn-fly 10s linear infinite; animation-delay: -5s; font-size: 2.5rem; }
@keyframes unicorn-fly {
  0% { left: 110%; transform: scaleX(-1) rotate(-5deg); }
  25% { transform: scaleX(-1) rotate(3deg) translateY(-20px); }
  50% { transform: scaleX(-1) rotate(-3deg) translateY(10px); }
  75% { transform: scaleX(-1) rotate(5deg) translateY(-15px); }
  100% { left: -15%; transform: scaleX(-1) rotate(-5deg); }
}

.butterfly {
  position: fixed; z-index: 1001; opacity: 0; transition: opacity 0.8s; pointer-events: none;
  width: 20px; height: 20px;
  background: radial-gradient(circle, #ff69b4 30%, #da70d6 70%);
  border-radius: 50% 0 50% 50%;
  box-shadow: -12px 0 0 0 rgba(218,112,214,0.7);
  transform-origin: center;
}
.butterfly-1 { animation: bfly1 12s ease-in-out infinite; }
.butterfly-2 { animation: bfly2 15s ease-in-out infinite; animation-delay: -4s; font-size: 1.5rem; }
.butterfly-3 { animation: bfly3 10s ease-in-out infinite; animation-delay: -7s; font-size: 2.5rem; }
@keyframes bfly1 { 0% { top:20%;left:10%;transform:rotate(10deg); } 25% { top:35%;left:40%;transform:rotate(-15deg) scaleX(-1); } 50% { top:15%;left:70%;transform:rotate(20deg); } 75% { top:50%;left:45%;transform:rotate(-10deg) scaleX(-1); } 100% { top:20%;left:10%;transform:rotate(10deg); } }
@keyframes bfly2 { 0% { top:60%;left:80%;transform:rotate(-5deg); } 25% { top:40%;left:50%;transform:rotate(15deg) scaleX(-1); } 50% { top:70%;left:20%;transform:rotate(-20deg); } 75% { top:30%;left:60%;transform:rotate(10deg) scaleX(-1); } 100% { top:60%;left:80%;transform:rotate(-5deg); } }
@keyframes bfly3 { 0% { top:80%;left:30%;transform:rotate(8deg); } 33% { top:50%;left:10%;transform:rotate(-12deg) scaleX(-1); } 66% { top:25%;left:55%;transform:rotate(15deg); } 100% { top:80%;left:30%;transform:rotate(8deg); } }

.girly-rain, .girly-sparkles { position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: 0; transition: opacity 0.6s; overflow: hidden; }
.girly-rain .g-drop { position: absolute; top: -5%; animation: g-fall linear infinite; opacity: 0.8; }
@keyframes g-fall { 0% { transform:translateY(0) rotate(0deg) scale(1); opacity:0.9; } 50% { transform:translateY(50vh) rotate(180deg) scale(0.8); opacity:0.7; } 100% { transform:translateY(105vh) rotate(360deg) scale(0.6); opacity:0; } }
.girly-sparkles .g-spark { position: absolute; animation: g-twinkle 1.5s ease-in-out infinite; }
@keyframes g-twinkle { 0%,100% { opacity:0; transform:scale(0.5) rotate(0deg); } 50% { opacity:1; transform:scale(1.2) rotate(180deg); } }

.claudia-trigger { cursor: pointer; display: inline-block; transition: all 0.3s; }
.girly-cursor, .girly-cursor * { cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><text y='28' font-size='28'>👑</text></svg>") 16 16, auto !important; }

body.girly-mode { color: #d4006a; }
body.girly-mode .topbar { background: linear-gradient(90deg, #ff69b4, #ff1493, #da70d6, #ff69b4); background-size: 300% 100%; animation: rainbow-bg 3s linear infinite, rainbow-border 2s linear infinite; border-bottom: 4px solid; }
body.girly-mode .logo { color: #fff; }
@keyframes rainbow-bg { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
@keyframes rainbow-border { 0% { border-color:#ff6b9d; } 25% { border-color:#ffd56b; } 50% { border-color:#6bff8d; } 75% { border-color:#a06bff; } 100% { border-color:#ff6b9d; } }

body.girly-mode .section-title, body.girly-mode .dash-tab-btn.active, body.girly-mode .tab-btn.active { color: #ff1493; border-color: #ff69b4; }
body.girly-mode table, body.girly-mode .results-table, body.girly-mode .report-list-table { background: rgba(255,255,255,0.85); border: 3px solid; animation: rainbow-border 2s linear infinite; box-shadow: 0 0 30px rgba(255,105,180,0.4); }
body.girly-mode th { background: linear-gradient(135deg, #ffb6c1, #ffc0cb, #ffb6d9); color: #d4006a; font-family: 'Comic Sans MS', cursive; }
body.girly-mode td { color: #8b008b; border-top-color: #ffb6c1; font-family: 'Comic Sans MS', cursive; }
body.girly-mode tr:hover td { background: rgba(255,105,180,0.15); }
body.girly-mode .claudia-trigger { color: #ff1493 !important; font-weight: 900; text-shadow: 0 0 12px rgba(255,20,147,0.8), 0 0 24px rgba(255,20,147,0.4); animation: claudia-glow 1s ease-in-out infinite alternate; }
@keyframes claudia-glow { from { text-shadow: 0 0 12px rgba(255,20,147,0.8); transform: scale(1); } to { text-shadow: 0 0 20px rgba(255,20,147,1), 0 0 40px rgba(255,20,147,0.6); transform: scale(1.05); } }

body.girly-mode .girly-bg { opacity: 1; }
body.girly-mode .cloud { opacity: 0.7; }
body.girly-mode .unicorn { opacity: 1; }
body.girly-mode .girly-rain { opacity: 1; }
body.girly-mode .girly-sparkles { opacity: 1; }
body.girly-mode .butterfly { opacity: 0.9; }

/* === Admin === */
/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL — "Surveillance Bureau" aesthetic
   ═══════════════════════════════════════════════════════════ */

/* --- Admin Header --- */
.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-panel) 90%, var(--accent) 10%) 0%, var(--bg) 100%);
}
.admin-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* --- Login Panel --- */
.admin-login-panel {
  max-width: 380px;
  margin: 60px auto;
  padding: 32px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 32px var(--shadow), 0 0 80px rgba(212,168,67,0.04);
  position: relative;
}
.admin-login-panel::before {
  content: 'ZUGANG BESCHRAENKT';
  position: absolute;
  top: -28px;
  left: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
}
.admin-login-panel label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-login-panel .input {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font-mono);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-login-panel .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim), inset 0 0 12px rgba(212,168,67,0.05);
}
.admin-login-panel .btn-primary {
  margin-top: 4px;
  padding: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* --- User Status Bar --- */
.admin-user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  margin: 0 0 2px;
  background: var(--bg-table-header);
  border-left: 3px solid var(--accent);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}
.admin-user-bar span:first-child { flex: 1; color: var(--text-muted); }
.admin-user-bar strong { color: var(--text-heading); }
.admin-role-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
.role-super { background: rgba(239,68,68,0.08); color: var(--error); border-color: rgba(239,68,68,0.3); }
.role-admin { background: rgba(212,168,67,0.08); color: var(--accent); border-color: rgba(212,168,67,0.3); }
.admin-user-bar .btn { font-size: 0.75rem; border-radius: var(--radius-sm); padding: 4px 12px; }

/* --- Password Change --- */
.admin-change-pw {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 20px;
  margin-bottom: 2px;
  flex-wrap: wrap;
  background: var(--bg-input);
  border-left: 3px solid var(--warning);
}
.admin-change-pw .input {
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  width: 180px;
  transition: border-color 0.2s;
}
.admin-change-pw .input:focus { outline: none; border-color: var(--accent); }
.text-success { color: var(--success); font-size: 0.82rem; font-weight: 600; }
.admin-superadmin-only.hidden { display: none; }

/* --- Tab Navigation --- */
.admin-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 24px;
  background: var(--bg-panel);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.admin-tab-btn {
  padding: 11px 22px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.admin-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-dim);
}
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* ═══ Penalty Cards ═══ */
.penalty-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.penalty-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.penalty-card:hover {
  border-color: color-mix(in srgb, var(--border) 40%, var(--text) 25%);
  box-shadow: 0 2px 16px var(--shadow);
}
.penalty-card--danger { border-left: 3px solid var(--error); }
.penalty-card--warn { border-left: 3px solid var(--warning); }
.penalty-card--info { border-left: 3px solid var(--success); }
.penalty-card--muted { border-left: 3px solid var(--text-muted); }

.penalty-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px 0;
}
.penalty-card__icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  flex-shrink: 0;
  border: 1px solid;
}
.penalty-card--danger .penalty-card__icon { background: rgba(239,68,68,0.08); color: var(--error); border-color: rgba(239,68,68,0.2); }
.penalty-card--warn .penalty-card__icon { background: rgba(245,158,11,0.08); color: var(--warning); border-color: rgba(245,158,11,0.2); }
.penalty-card--info .penalty-card__icon { background: rgba(34,197,94,0.08); color: var(--success); border-color: rgba(34,197,94,0.2); }
.penalty-card--muted .penalty-card__icon { background: rgba(107,114,128,0.08); color: var(--text-muted); border-color: rgba(107,114,128,0.2); }

.penalty-card__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
  letter-spacing: 0.03em;
}
.penalty-card__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 2px 0 0;
  line-height: 1.35;
}

/* --- Card Forms --- */
.penalty-card__form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 20px 16px;
  flex-wrap: wrap;
}
.penalty-field { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.penalty-field--small { min-width: 70px; max-width: 85px; }
.penalty-field--grow { flex: 1; min-width: 140px; }
.penalty-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.penalty-input {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.penalty-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.penalty-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.penalty-select {
  cursor: pointer; appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-color: var(--bg-input);
}

/* --- Action Button --- */
.penalty-btn {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.06em;
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
  flex-shrink: 0;
  align-self: flex-end;
}
.penalty-btn:active { transform: scale(0.97); }
.penalty-btn--add {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212,168,67,0.25);
}
.penalty-btn--add:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(212,168,67,0.35);
}

/* --- Card Tables --- */
.penalty-card__table-wrap {
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.penalty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.penalty-table thead th {
  padding: 9px 16px;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border);
}
.penalty-table thead th:last-child { text-align: right; width: 90px; }
.penalty-table tbody td {
  padding: 9px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  color: var(--text);
  font-size: 0.82rem;
}
.penalty-table tbody tr:last-child td { border-bottom: none; }
.penalty-table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
.penalty-table tbody tr:hover { background: var(--bg-hover); }
.penalty-table tbody td:last-child { text-align: right; }
.penalty-table .btn-sm.btn-danger {
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid rgba(239,68,68,0.4);
  color: var(--error);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s, border-color 0.15s;
}
.penalty-table .btn-sm.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--error); }
.penalty-table .btn-sm {
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.penalty-table .text-muted { color: var(--text-muted); font-style: italic; }

/* ═══ Autocomplete ═══ */
.autocomplete-wrap { position: relative; width: 100%; }
.autocomplete-list {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 100;
  max-height: 180px; overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.autocomplete-list.hidden { display: none; }
.autocomplete-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
  transition: background 0.08s;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
  font-family: var(--font-mono);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--accent-dim);
  color: var(--text-heading);
}

/* --- Admin Reports --- */

.admin-reports-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ar-card {
  display: flex;
  align-items: stretch;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ar-card:hover {
  border-color: color-mix(in srgb, var(--border) 40%, var(--text) 25%);
  box-shadow: 0 2px 8px var(--shadow);
}
.ar-card--excluded { opacity: 0.45; }
.ar-card--excluded:hover { opacity: 0.7; }

.ar-card__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-width: 80px;
  border-left: 3px solid var(--border);
  background: var(--bg-table-header);
  gap: 2px;
}
.ar-zone {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ar-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-heading);
}
.ar-day {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ar-card__mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px;
  gap: 3px;
  min-width: 0;
}
.ar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-title:hover { color: var(--accent); }
.ar-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-meta strong { color: var(--text); }

.ar-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 14px;
  gap: 6px;
  min-width: 140px;
}
.ar-status {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.ar-status--ok { background: rgba(34,197,94,0.12); color: var(--success); }
.ar-status--partial { background: rgba(245,158,11,0.12); color: var(--warning); }
.ar-status--pending { background: rgba(212,168,67,0.08); color: var(--accent); }
.ar-status--missing { background: rgba(107,114,128,0.08); color: var(--text-muted); }
.ar-status--running { background: rgba(212,168,67,0.12); color: var(--accent); animation: pulse 1.5s ease-in-out infinite; }
.ar-excluded-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--error);
}
.ar-actions {
  display: flex;
  gap: 4px;
}
.ar-log {
  border-top: 1px solid var(--border);
  background: var(--bg);
  animation: modal-fade-in 0.2s ease-out;
}
.ar-log__header {
  padding: 6px 14px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border);
}
.ar-log__content {
  padding: 10px 14px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.text-error {
  color: var(--error);
  font-size: 0.85rem;
}
#admin-reports {
  padding: 0 24px 24px;
}
.row-excluded {
  opacity: 0.5;
}
.badge-excluded {
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-included {
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
}
.btn-exclude {
  color: var(--error) !important;
  border-color: var(--error) !important;
}
.btn-include {
  color: var(--success) !important;
  border-color: var(--success) !important;
}
.badge-ok {
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-partial {
  color: var(--warning, #f0ad4e);
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-pending {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-missing {
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.7;
}
.badge-running {
  color: var(--accent, #4fc3f7);
  font-size: 0.75rem;
  font-weight: 600;
  animation: pulse 1.5s ease-in-out infinite;
}
.badge-error {
  color: var(--error);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: help;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.admin-actions {
  white-space: nowrap;
}
.admin-actions .btn {
  margin: 0 2px;
}

/* === Bug Tracker === */
#view-bugs {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
#view-bugs .admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
#view-bugs .admin-header h2 {
  font-size: 1.1rem;
  color: var(--text-heading);
}

/* Form */
.bugs-form {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  position: relative;
}
.bugs-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--error), var(--warning));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.bugs-form .input {
  width: 100%;
  display: block;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bugs-form .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.bugs-form .input::placeholder { color: var(--text-muted); }
.bugs-form textarea.input { resize: vertical; min-height: 60px; }

/* Ticket cards */
.bug-ticket {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: 2px var(--radius) var(--radius) 2px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.bug-ticket:hover {
  border-left-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transform: translateX(2px);
}
.bug-ticket-done {
  opacity: 0.5;
  border-left-color: var(--success);
}
.bug-ticket-done:hover { border-left-color: var(--success); opacity: 0.7; }

.bug-ticket-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
}
.bug-ticket-header strong {
  color: var(--text-muted);
  font-weight: 600;
}
.bug-ticket-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}
.bug-ticket-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  line-height: 1.5;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
}
.bug-ticket-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.bug-ticket-actions .btn {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bug-ticket-actions .btn-success {
  background: rgba(34,197,94,0.12);
  color: var(--success);
  border-color: rgba(34,197,94,0.3);
}
.bug-ticket-actions .btn-success:hover {
  background: rgba(34,197,94,0.25);
  border-color: var(--success);
}
.bug-ticket-actions .btn-danger {
  background: rgba(239,68,68,0.08);
  color: var(--error);
  border-color: rgba(239,68,68,0.2);
}
.bug-ticket-actions .btn-danger:hover {
  background: rgba(239,68,68,0.18);
  border-color: var(--error);
}

/* Status badges */
.bug-status {
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-open { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-closed { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-wontfix { background: rgba(107,114,128,0.15); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); }

/* Empty state */
#bugs-list .text-muted { text-align: center; padding: 3rem 1rem; font-size: 0.85rem; }
#bugs-list .text-error { text-align: center; padding: 2rem 1rem; }

/* Role badges in progression */
.role-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
  opacity: 0.7;
}
.role-tank { background: rgba(59,130,246,0.2); color: #60a5fa; }
.role-heal { background: rgba(34,197,94,0.2); color: #4ade80; }
.role-dd { background: rgba(239,68,68,0.15); color: #f87171; }
