/* ==========================================================================
   ArcheAge Quest Tracker - Dual Theme Stylesheet (Dark & Light)
   ========================================================================== */

:root {
  /* Default Dark Theme */
  --bg-body: #0a0e17;
  --bg-header: rgba(11, 17, 29, 0.9);
  --bg-card: rgba(18, 26, 43, 0.85);
  --bg-card-hover: rgba(28, 40, 65, 0.95);
  --bg-input: rgba(15, 23, 42, 0.8);
  --bg-subtle: rgba(30, 41, 59, 0.6);
  --bg-modal: rgba(15, 23, 42, 0.95);
  
  --table-header-bg: #111a2e;
  --table-header-text: #94a3b8;
  --table-row-hover: rgba(30, 41, 59, 0.45);
  --table-foot-bg: #0d1525;
  --table-border: rgba(71, 85, 105, 0.35);
  --border-color: rgba(71, 85, 105, 0.35);
  --border-glow: rgba(59, 130, 246, 0.25);
  
  --today-col-bg: rgba(56, 189, 248, 0.08);
  --today-col-header: rgba(14, 116, 144, 0.3);
  --today-text: #38bdf8;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --primary-gradient-hover: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  
  --gold: #f59e0b;
  --gold-bg: rgba(245, 158, 11, 0.1);
  --gold-border: rgba(245, 158, 11, 0.3);
  
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.35);
  --emerald-card-bg: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(18, 26, 43, 0.85) 100%);
  --emerald-text: #34d399;
  
  --crimson: #ef4444;
  --crimson-bg: rgba(239, 68, 68, 0.12);
  --crimson-card-bg: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, rgba(18, 26, 43, 0.85) 100%);
  --crimson-text: #f87171;
  
  --blue-card-bg: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(18, 26, 43, 0.85) 100%);
  --blue-text: #60a5fa;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --checkbox-bg: rgba(15, 23, 42, 0.7);
  --checkbox-border: rgba(148, 163, 184, 0.4);
  --card-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5);
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: 'Cinzel', serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="light"] {
  /* Light Theme */
  --bg-body: #f8fafc;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-modal: #ffffff;
  
  --table-header-bg: #f1f5f9;
  --table-header-text: #334155;
  --table-row-hover: #f8fafc;
  --table-foot-bg: #f8fafc;
  --table-border: #e2e8f0;
  --border-color: #e2e8f0;
  --border-glow: rgba(37, 99, 235, 0.15);
  
  --today-col-bg: rgba(14, 165, 233, 0.07);
  --today-col-header: rgba(14, 165, 233, 0.15);
  --today-text: #0284c7;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --primary-gradient-hover: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  
  --gold: #b45309;
  --gold-bg: rgba(245, 158, 11, 0.12);
  --gold-border: rgba(217, 119, 6, 0.3);
  
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-card-bg: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  --emerald-text: #15803d;
  
  --crimson: #dc2626;
  --crimson-bg: #fef2f2;
  --crimson-card-bg: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
  --crimson-text: #b91c1c;
  
  --blue-card-bg: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  --blue-text: #1d4ed8;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --checkbox-bg: #ffffff;
  --checkbox-border: #94a3b8;
  --card-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

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

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Ambient glows (subtle in dark, hidden in light) */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s;
}
.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(0,0,0,0) 70%);
  top: -150px;
  right: -100px;
}
.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(0,0,0,0) 70%);
  bottom: -200px;
  left: -150px;
}
[data-theme="light"] .bg-glow {
  opacity: 0.15;
}

.container {
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.25s, border-color 0.25s;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-badge {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}
.logo-title {
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--text-main);
  line-height: 1.1;
}
.logo-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--gold);
}

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

/* Theme Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}
.theme-toggle:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

#headerAuthArea {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-subtle);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}
.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  box-shadow: var(--card-shadow);
  transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

/* Hero Banner */
.hero-banner {
  margin: 40px auto;
  padding: 40px;
  text-align: center;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: linear-gradient(180deg, rgba(23, 37, 84, 0.3) 0%, var(--bg-card) 100%);
}
[data-theme="light"] .hero-banner {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}
.hero-content h2 {
  font-family: var(--font-title);
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--text-main);
}
.hero-content p {
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 24px;
  font-size: 15px;
}
.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}
.hero-features {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.feature-icon {
  font-size: 18px;
}

/* Compact Week Info Bar */
.week-nav {
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 8px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.week-info-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.week-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  background: var(--gold-bg);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--gold-border);
}
.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--gold);
}
.week-label-compact {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* Compact KPI Stats Dashboard Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--card-shadow);
}
.kpi-card:hover {
  border-color: rgba(148, 163, 184, 0.4);
}
.kpi-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}
.kpi-card-green {
  border-color: var(--emerald-border);
  background: var(--emerald-card-bg);
}
.kpi-value.green { color: var(--emerald-text); }

.kpi-card-red {
  border-color: rgba(239, 68, 68, 0.3);
  background: var(--crimson-card-bg);
}
.kpi-value.red { color: var(--crimson-text); }

.kpi-card-blue {
  border-color: var(--border-glow);
  background: var(--blue-card-bg);
}
.kpi-value.blue { color: var(--blue-text); }

.progress-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Tracker Table */
.tracker-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 40px;
  border: 1px solid var(--border-color);
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.tracker-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.tracker-table th,
.tracker-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--table-border);
  border-right: 1px solid var(--table-border);
}
.tracker-table th:last-child,
.tracker-table td:last-child {
  border-right: none;
}

/* FIXED TABLE HEADER: No more floating sticky overlap bugs! */
.tracker-table thead th {
  background: var(--table-header-bg);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--table-header-text);
  border-bottom: 2px solid var(--border-color);
  user-select: none;
}
.tracker-table tbody tr {
  transition: background-color 0.15s;
}
.tracker-table tbody tr:hover {
  background-color: var(--table-row-hover);
}

/* Specific Columns */
.col-num { width: 44px; text-align: center; color: var(--text-muted); }
.col-name { min-width: 240px; font-weight: 600; color: var(--text-main); }
.col-pts { width: 92px; text-align: center; }
.col-npc { min-width: 270px; color: var(--text-muted); font-size: 12px; }
.col-day {
  width: 68px;
  text-align: center;
  vertical-align: middle;
}
.col-total { width: 80px; text-align: center; font-weight: 700; }
.col-notes { min-width: 160px; font-size: 12px; }

/* Points Badge (Tier-based matching ArcheAge event cards) */
.pts-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  user-select: none;
}
.pts-icon {
  font-size: 11px;
}
.pts-tier-1 {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}
.pts-tier-2 {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.pts-tier-4 {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.pts-tier-5 {
  background: rgba(236, 72, 153, 0.2);
  border: 1px solid rgba(236, 72, 153, 0.45);
  color: #f472b6;
}

[data-theme="light"] .pts-tier-1 {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
[data-theme="light"] .pts-tier-2 {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0284c7;
}
[data-theme="light"] .pts-tier-4 {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}
[data-theme="light"] .pts-tier-5 {
  background: #fce7f3;
  border-color: #f472b6;
  color: #be185d;
}

.kpi-goal-sub {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-value.gold { color: #f59e0b; }
.status-in-progress {
  font-size: 15px !important;
  color: #f59e0b;
}
.status-completed {
  font-size: 15px !important;
  color: #10b981;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.kpi-card-completed {
  border-color: #10b981 !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.15) 0%, var(--bg-card) 100%) !important;
}

/* Day Header Cell */
.day-header-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.day-header-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-main);
}
.day-header-date {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
}

/* Today Column Highlight (Clean and contained inside the cell, no floating line) */
.is-today-col {
  background-color: var(--today-col-bg) !important;
}
th.is-today-col {
  background-color: var(--today-col-header) !important;
}
th.is-today-col .day-header-name {
  color: var(--today-text);
  font-weight: 800;
}

/* Checkbox Cell & UI Component */
.checkbox-cell {
  text-align: center;
  padding: 8px 4px !important;
  cursor: pointer;
}
.checkbox-cell.is-checked {
  background-color: var(--emerald-bg);
}

.custom-checkbox {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--checkbox-border);
  background: var(--checkbox-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.custom-checkbox:hover {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
  transform: scale(1.08);
}
.custom-checkbox.checked {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.custom-checkbox.checked::after {
  content: '✔';
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

/* Quest Total Badge */
.total-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.total-badge.full {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald-text);
}

/* Quest Notes */
.note-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px dashed transparent;
  transition: all 0.15s;
}
.note-box:hover {
  border-color: var(--border-color);
  background: var(--bg-subtle);
}
.note-text {
  color: var(--text-dim);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.note-text.has-content {
  color: var(--text-main);
  font-style: normal;
}
.note-edit-icon {
  font-size: 12px;
  opacity: 0.5;
}
.note-box:hover .note-edit-icon {
  opacity: 1;
  color: var(--primary);
}

/* Table Footer (Summary) */
tfoot {
  background: var(--table-foot-bg);
  border-top: 2px solid var(--border-color);
  font-weight: 700;
}
.tfoot-title {
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.tfoot-day {
  text-align: center;
  font-size: 13px;
  color: var(--emerald-text);
}
.tfoot-total {
  text-align: center;
  color: var(--blue-text);
  font-size: 13px;
}
.tfoot-percent-row td {
  border-bottom: none;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 11px;
}
.tfoot-percent-row .tfoot-day {
  color: var(--emerald);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: var(--primary-gradient-hover);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
}
.btn-ghost {
  background: none;
  color: var(--text-muted);
  border-color: var(--border-color);
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}
.btn-lg {
  padding: 12px 24px;
  font-size: 14px;
  border-radius: var(--radius-md);
}
.btn-block {
  width: 100%;
}

/* Modal Window */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 15, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  position: relative;
  border: 1px solid var(--border-color);
  background: var(--bg-modal);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.25s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text-main); }

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.modal-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-tab.active {
  color: var(--text-main);
  border-bottom-color: var(--primary);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.modal-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--primary);
}
.form-textarea {
  resize: vertical;
  line-height: 1.4;
}

/* Anti-Spam Captcha Box */
.captcha-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 20px;
}
.captcha-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.shield-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}
.btn-refresh {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.captcha-question {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

/* Alerts & Toasts */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert-error {
  background: var(--crimson-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--crimson-text);
}
.alert-success {
  background: var(--emerald-bg);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-text);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-modal);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlide 0.3s ease-out;
}
@keyframes toastSlide {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .header-inner {
    height: 64px;
  }
  .logo-title {
    font-size: 17px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-banner {
    padding: 24px 16px;
  }
  .hero-features {
    gap: 16px;
  }
  .week-nav {
    flex-direction: column;
    gap: 14px;
  }
  .theme-text {
    display: none;
  }
}

/* ==========================================================================
   Admin Panel Styles (Master-Detail Dashboard)
   ========================================================================== */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.28));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #f59e0b;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-admin:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.5));
  border-color: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.modal-xl {
  max-width: 1100px;
  width: 95vw;
  height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.admin-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-shield-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
}
.admin-main-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}
.admin-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  margin: 2px 0 0 0;
}

/* KPI Summary Cards */
.admin-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.admin-kpi-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.admin-kpi-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}
.admin-kpi-num.green { color: var(--emerald); }
.admin-kpi-num.gold { color: var(--gold); }
.admin-kpi-num.red { color: var(--crimson); }
.admin-kpi-txt {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
}

/* Master-Detail 2-Column Workspace */
.admin-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

/* Left Pane: Players Directory */
.admin-left-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 0;
}
.admin-search-box {
  margin-bottom: 10px;
}
.admin-search-box .form-input {
  font-size: 12px;
  padding: 8px 12px;
}
.admin-filter-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.admin-pill {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-pill.active, .admin-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.admin-user-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.admin-user-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-user-item:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}
.admin-user-item.active {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: inset 3px 0 0 var(--primary);
}
.admin-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.admin-user-info {
  flex: 1;
  min-width: 0;
}
.admin-user-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.admin-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-user-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

/* Right Pane: Selected Player Inspection */
.admin-right-pane {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  overflow-y: auto;
  min-height: 0;
}
.admin-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-main);
  padding: 40px;
}
.admin-player-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 14px;
}
.admin-player-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}
.admin-player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.admin-player-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}
.admin-player-meta {
  font-size: 11px;
  color: var(--text-dim);
}
.admin-player-progress-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.admin-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}
.admin-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
  font-weight: 800;
  margin: 0 0 10px 0;
}

/* 7-Day Matrix Table */
.admin-player-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  background: var(--card-bg);
}
.admin-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: center;
}
.admin-matrix-table th {
  background: var(--table-header-bg);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
}
.admin-matrix-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}
.admin-matrix-table td.quest-title-cell {
  text-align: left;
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.matrix-done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-text);
  font-weight: 800;
  border-radius: 4px;
}
.matrix-empty {
  color: var(--text-dim);
  opacity: 0.4;
}

/* Badges & Buttons */
.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}
.badge-status-active {
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-text);
}
.badge-status-banned {
  background: var(--crimson-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--crimson-text);
}
.badge-admin {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
}
.btn-ban {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--crimson-text);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-ban:hover {
  background: rgba(239, 68, 68, 0.35);
}
.btn-unban {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-text);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-unban:hover {
  background: rgba(16, 185, 129, 0.35);
}
.admin-notes-list {
  display: grid;
  gap: 8px;
}
.admin-note-item {
  background: var(--card-bg);
  border-left: 3px solid var(--gold);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
}

/* ==========================================================================
   Character Switcher Bar (Multi-Character / Twinks)
   ========================================================================== */
.character-bar {
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  border-radius: var(--radius-md);
}
.character-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.character-bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-color);
}
.char-icon {
  font-size: 16px;
}
.character-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.char-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.char-pill:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}
.char-pill.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.25);
}
.char-pill-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-color);
}
.char-pill.active .char-pill-name {
  color: #60a5fa;
}
.char-pill-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.char-pill-badge.completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-text);
  border-color: var(--emerald-border);
}
.char-pill-server {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.char-pill-del {
  margin-left: 2px;
  color: var(--text-dim);
  font-size: 13px;
  padding: 0 2px;
  border-radius: 4px;
  transition: color 0.15s;
}
.char-pill-del:hover {
  color: #ef4444;
}


/* ==========================================================================
   ArcheAge UI Vector Icons
   ========================================================================== */
.ui-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  fill: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.ui-icon-sm {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.ui-icon-lg {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}
.ui-icon-xl {
  width: 42px;
  height: 42px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.35));
}
.modal-top-icon {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.ui-icon-coin {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 4px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
.logo-badge-svg {
  width: 24px;
  height: 24px;
  vertical-align: 0;
}
.char-icon-svg {
  margin-right: 6px;
}
.kpi-icon {
  margin-right: 6px;
  vertical-align: -2px;
}
.char-pill-svg {
  vertical-align: -2px;
}
.note-quill-svg {
  color: var(--gold);
}
.day-star-svg {
  width: 10px;
  height: 10px;
  vertical-align: 0px;
  margin-left: 2px;
}
.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid var(--border-color);
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   Generated ArcheAge 3D Image Assets
   ========================================================================== */
.logo-badge {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--gold-border);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
}
.logo-badge-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.char-icon-img {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 50%;
  border: 1.5px solid var(--gold-border);
  margin-right: 8px;
  vertical-align: -6px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.token-coin-img {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.7);
  vertical-align: -3px;
  margin-right: 5px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}
.ui-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  vertical-align: -2px;
  fill: currentColor;
  flex-shrink: 0;
}
