/* =========================================
   1. RESET & ROOT VARIABLES
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
    --primary-yellow: #FFD700;
    --dark-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-white: #ffffff;
    --text-gray: #b0b0b0;
    --accent-green: #4ade80;
    --accent-red: #ef4444;
    --gradient-start: #FFD700;
    --gradient-end: #FFA500;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark-bg);
  min-height: 100vh;
  color: var(--text-white);
  line-height: 1.6;
}

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

/* =========================================
   2. APPLICATION HEADER
   ========================================= */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
  padding: 16px 4%;
  background: rgba(8, 8, 8, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.app-identity,
.app-action,
.app-menu-panel a {
  color: var(--text-white);
  text-decoration: none;
}

.app-identity {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.focus-signal {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  visibility: visible;
  width: 58px;
  height: 58px;
  border: 2px solid #7275c6;
  border-radius: 20px;
  background: #101018;
  box-shadow: 0 0 18px rgba(114, 117, 198, 0.14);
}

.focus-signal span {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(114, 117, 198, 0.35);
  border-radius: 50%;
  background: rgba(114, 117, 198, 0.06);
  box-shadow: 0 0 12px rgba(114, 117, 198, 0.12);
}

.focus-signal span::after {
  content: '';
  width: 13px;
  height: 13px;
  border: 3px solid #b8b9ff;
  border-radius: 50%;
  background: #9698ff;
  box-shadow: 0 0 12px rgba(150, 152, 255, 0.9);
}

.focus-signal.is-running {
  animation: focus-signal-pulse 1.6s ease-in-out infinite;
}

@keyframes focus-signal-pulse {
  0%, 100% { opacity: .65; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}

.app-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  background: linear-gradient(145deg, #a9b4ff, #6366f1);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
}

.app-avatar-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1rem;
}

.app-identity-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-identity-copy strong {
  overflow: hidden;
  font-size: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-identity-copy small {
  color: var(--text-gray);
  font-size: 0.78rem;
}

.profile-signal {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(167, 168, 255, 0.45);
  border-radius: 10px;
  background: rgba(167, 168, 255, 0.12);
  color: #d4d5ff;
  font-size: .8rem;
  font-weight: 800;
}

.profile-visibility-icon {
  margin-right: 4px;
}

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

.app-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.app-menu-trigger {
  color: var(--text-white);
  font-family: inherit;
}

.app-action:hover {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(124, 92, 246, 0.2);
  transform: translateY(-1px);
}

.app-calendar-action {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(20, 184, 166, 0.14);
}

.app-action-icon {
  color: #a78bfa;
  font-size: 1.2rem;
}

.app-calendar-action .app-action-icon {
  color: #2dd4bf;
}

.app-chevron {
  color: #aaa;
  font-size: 1.1rem;
}

.app-profile-action {
  min-width: 76px;
  padding: 7px 11px;
}

.app-menu {
  position: relative;
}

.app-menu::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 10px;
}

.app-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: block;
  min-width: 180px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #171717;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.app-menu:hover > .app-menu-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.app-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
}

.app-menu-panel a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.navbar {
  display: none;
}

@media (max-width: 700px) {
  .app-header {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 52px;
    padding: 7px 10px;
    overflow: hidden;
  }

  .app-identity {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .app-identity-copy {
    min-width: 0;
  }

  .app-identity-copy strong {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .app-identity-copy small {
    display: none;
  }

  .app-signal,
  .focus-signal {
    width: 38px;
    height: 38px;
  }

  .focus-signal span {
    width: 22px;
    height: 22px;
  }

  .app-actions {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
  }

  .app-action {
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .app-action-icon {
    font-size: 0.95rem;
  }

  .app-profile-action {
    min-width: 44px;
    padding: 5px 8px;
  }
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    margin-bottom: 20px;
}

.navbar h2 {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-white);
  padding: 8px 16px;
  border-radius: 50px;
  transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-yellow);
  color: var(--dark-bg);
}

/* =========================================
   3. DASHBOARD HEADER & STATS BAR
   ========================================= */
.dashboard-header {
  text-align: center;
  padding: 5px 20px;
  margin-bottom: 10px;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fff, var(--primary-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.dashboard-header p {
    font-size: 1rem;
    color: var(--text-gray);
    margin-top: 0;
}

.track-btn-header {
    margin-top: 20px;
    background-color: var(--card-bg);
    color: var(--primary-yellow);
    border: 1px solid var(--primary-yellow);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.track-btn-header:hover {
    background-color: var(--primary-yellow);
    color: var(--dark-bg);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

/* --- RESTORED XP & STATS BAR STYLES --- */
.user-stats-bar {
  background-color: var(--card-bg);
  padding: 15px 20px;
  border-radius: 50px;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 215, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.level-display {
  font-weight: bold;
  color: var(--dark-bg);
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* Original XP Container */
.xp-container {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Original XP Counter Box */
.xp-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--dark-bg);
  padding: 6px 15px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--primary-yellow);
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.xp-counter:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(253, 197, 0, 0.3);
}

/* Tooltip & Icon */
.info-icon {
  position: relative;
  cursor: pointer;
  color: var(--text-gray);
  display: flex;
  align-items: center;
}

.info-icon .tooltip {
  visibility: hidden;
  width: 240px;
  background-color: #2a2a2a;
  color: var(--text-white);
  text-align: left;
  border-radius: 10px;
  padding: 15px;
  position: absolute;
  z-index: 5;
  top: 150%;
  right: 0;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.info-icon:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.tooltip p {
  margin: 0 0 5px 0;
  color: var(--primary-yellow);
  font-size: 0.9em;
}

.tooltip ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.tooltip ul li {
  font-size: 0.85em;
  color: var(--text-gray);
  margin-bottom: 3px;
}

/* Progress Bar */
.xp-progress-bar-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
    position: relative;
}

.xp-progress-fill {
    height: 100%;
    background-color: #ffd700;
    width: 0%;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* =========================================
   4. SPLIT GRID (Today & History)
   ========================================= */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 35% 1fr;
  gap: 20px;
  margin-bottom: 30px;
  align-items: stretch;
}

.today-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 20px;
  padding: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
  height: 100%;
  min-height: 300px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: border-color 0.3s;
}

.today-card.status-green { border-color: rgba(74, 222, 128, 0.4); }
.today-card.status-red { border-color: rgba(239, 68, 68, 0.4); }
.today-card.status-yellow { border-color: rgba(255, 215, 0, 0.4); }

.today-card h3 { color: var(--text-gray); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 25px; }

.circular-loader {
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; margin-bottom: 25px; box-shadow: 0 0 25px rgba(0,0,0,0.3);
}
.circular-loader::before {
  content: ""; position: absolute; width: 120px; height: 120px;
  background: var(--card-bg); border-radius: 50%;
}
.loader-content { position: relative; z-index: 2; text-align: center; }
.loader-hours { font-size: 2.2rem; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.loader-sub { font-size: 0.8rem; color: var(--text-gray); font-weight: 500; }
.today-summary { font-size: 0.9rem; background: rgba(255,255,255,0.05); padding: 8px 18px; border-radius: 50px; font-weight: 600; }

.history-grid-container {
  display: flex; flex-direction: column; justify-content: space-between; gap: 15px; height: 100%;
}

.history-card-row {
  background: #151515;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  transition: all 0.2s ease;
}

.history-card-row:hover {
  transform: translateX(5px);
  background: #1a1a1a;
  border-color: rgba(255, 215, 0, 0.2);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.calendar-date-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 55px; height: 55px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); flex-shrink: 0;
}
.cal-weekday { font-size: 0.7rem; color: var(--primary-yellow); text-transform: uppercase; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.cal-daynum { font-size: 1.4rem; color: var(--text-white); font-weight: 800; line-height: 1; }

.history-details { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; }
.history-meta { display: flex; align-items: center; }
.history-hours-val { color: var(--text-white); font-weight: 600; font-size: 1.1rem; }
.history-progress-track { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 10px; overflow: hidden; }
.history-progress-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease-out; }

.history-badge-container { flex-shrink: 0; }
.history-pct-badge {
    font-size: 0.95rem; padding: 8px 12px; border-radius: 10px; font-weight: 700; min-width: 65px; text-align: center; display: inline-block;
}
.text-green { color: #4ade80; background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.2); }
.text-red { color: #ef4444; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); }
.text-yellow { color: #ffd700; background: rgba(255, 215, 0, 0.1); border: 1px solid rgba(255, 215, 0, 0.2); }

/* =========================================
   5. GENERAL UI COMPONENTS
   ========================================= */
.form-box, .form-box-new {
  background: var(--card-bg); padding: 40px; border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5); max-width: 500px; margin: 40px auto; border: 1px solid rgba(255, 215, 0, 0.1);
}
.form-box h1 { margin-bottom: 20px; text-align: center; font-size: 2.5rem; background: linear-gradient(135deg, #fff, var(--primary-yellow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-gray); }
.form-group input { width: 100%; padding: 12px; background: var(--dark-bg); color: var(--text-white); border: 1px solid rgba(255, 215, 0, 0.2); border-radius: 10px; font-size: 16px; transition: border-color 0.3s; }
.form-group input:focus { outline: none; border-color: var(--primary-yellow); }

.btn { width: 100%; padding: 1rem 2.5rem; border-radius: 50px; font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: all 0.3s; text-decoration: none; display: inline-block; text-align: center; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); color: var(--dark-bg); border: none; }
.btn:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4); }
.btn1 { width: 100%; padding: 1rem 2.5rem; border-radius: 50px; font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: all 0.3s; text-decoration: none; display: inline-block; text-align: center; background: transparent; color: var(--primary-yellow); border: 2px solid var(--primary-yellow); position: relative; }
.btn1:hover { background: var(--primary-yellow); color: var(--dark-bg); }
.quick-action { text-align: center; margin-top: 20px; }
.quick-action.full-width { margin-bottom: 20px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card-bg); padding: 2rem; border-radius: 20px; text-align: center; border: 1px solid rgba(255, 215, 0, 0.1); transition: all 0.3s; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-color: rgba(255, 215, 0, 0.3); }
.stat-card h3 { color: var(--text-gray); margin-bottom: 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.stat-number { font-size: 2.5rem; font-weight: bold; color: var(--primary-yellow); margin: 10px 0; }
.total-hours-selector { margin-top: 10px; background-color: var(--dark-bg); color: var(--text-white); border: 1px solid rgba(255, 215, 0, 0.2); padding: 8px; border-radius: 10px; cursor: pointer; }

/* Recent Activity */
.recent-activity { background: var(--card-bg); padding: 30px; border-radius: 20px; margin-bottom: 20px; border: 1px solid rgba(255, 215, 0, 0.1); }
.recent-activity h2 { margin-bottom: 20px; font-size: 1.5rem; color: var(--primary-yellow); }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 15px; text-align: left; border-bottom: 1px solid rgba(255, 215, 0, 0.1); }
table th { font-weight: 600; color: var(--text-gray); font-size: 0.9rem; text-transform: uppercase; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: rgba(74, 222, 128, 0.1); color: var(--accent-green); }
.badge-red { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }

/* Calendar & Analytics */
.add-log-form, .calendar-view, .chart-container { background: var(--card-bg); padding: 30px; border-radius: 20px; margin-bottom: 30px; border: 1px solid rgba(255, 215, 0, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 20px; }
.calendar-day { aspect-ratio: 1; padding: 10px; border-radius: 8px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: transform 0.2s; }
.calendar-day:hover { transform: translateY(-3px); }
.day-number { font-size: 1.1rem; font-weight: bold; }
.day-hours { font-size: 1.5rem; font-weight: 600; color: var(--text-white); }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-top: 20px; background: var(--card-bg); border: 1px solid rgba(255, 215, 0, 0.1); padding: 20px; border-radius: 20px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-color { width: 25px; height: 25px; border-radius: 5px; }
.legend-text { font-size: 0.9em; color: var(--text-gray); }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.calendar-header h2 { color: var(--primary-yellow); margin: 0; font-size: 1.8rem; }
.month-nav { text-decoration: none; color: var(--primary-yellow); font-size: 2rem; font-weight: bold; padding: 0 15px; border-radius: 50px; transition: background-color 0.3s; }
.month-nav:hover { background-color: rgba(255, 215, 0, 0.1); }
.month-nav.disabled { color: #555; cursor: not-allowed; }

.chart-wrapper { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 300px; }
.chart-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.chart-controls { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; margin-bottom: 15px; }
input[type="month"], input[type="date"] { background-color: var(--dark-bg); color: var(--text-white); border: 1px solid rgba(255, 215, 0, 0.2); padding: 8px; border-radius: 10px; font-family: inherit; font-size: 14px; color-scheme: dark; }
.period-selector { background-color: var(--dark-bg); color: var(--text-white); border: 1px solid rgba(255, 215, 0, 0.2); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
.scrollable-chart-outer { width: 100%; overflow-x: auto; overflow-y: hidden; border: 1px solid rgba(255, 215, 0, 0.1); border-radius: 10px; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: var(--primary-yellow) var(--card-bg); }
.scrollable-chart-outer::-webkit-scrollbar { height: 8px; }
.scrollable-chart-outer::-webkit-scrollbar-track { background: var(--card-bg); border-radius: 4px; }
.scrollable-chart-outer::-webkit-scrollbar-thumb { background-color: var(--primary-yellow); border-radius: 4px; }
.scrollable-chart-inner { position: relative; height: 300px; display: block; }
.chart-wrapper canvas, .scrollable-chart-inner canvas { width: 100% !important; height: 100% !important; }

/* Modals & Popups (RESTORED XP POPUP) */
.modal-overlay, .achievement-popup { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(4px); padding: 20px; }
.modal-content, .achievement-popup-content { background: #1e1e1e; padding: 30px; border-radius: 16px; width: 100%; max-width: 400px; position: relative; border: 1px solid rgba(255, 255, 255, 0.1); }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #888; }

.xp-popup { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); }
.xp-popup-content { background-color: var(--card-bg); margin: 10% auto; padding: 30px; border: 1px solid var(--primary-yellow); width: 80%; max-width: 600px; border-radius: 20px; position: relative; box-shadow: 0 5px 25px rgba(253, 197, 0, 0.2); }
.xp-popup-close { color: var(--text-gray); position: absolute; top: 15px; right: 25px; font-size: 35px; font-weight: bold; transition: color 0.3s; }
.xp-popup-close:hover { color: var(--primary-yellow); cursor: pointer; }
.xp-popup-content h2 { color: var(--primary-yellow); text-align: center; margin-bottom: 25px; }
.xp-history-list { max-height: 400px; overflow-y: auto; padding-right: 15px; }
.xp-history-list h3 { color: var(--primary-yellow); margin-top: 20px; margin-bottom: 10px; border-bottom: 1px solid rgba(255, 215, 0, 0.1); padding-bottom: 5px; }
.xp-history-list ul { list-style-type: none; padding: 0; }
.xp-history-list li { background-color: var(--dark-bg); padding: 12px; border-radius: 10px; margin-bottom: 8px; font-size: 0.95em; border-left: 3px solid var(--primary-yellow); }
.xp-history-list::-webkit-scrollbar { width: 8px; }
.xp-history-list::-webkit-scrollbar-track { background: var(--dark-bg); border-radius: 10px; }
.xp-history-list::-webkit-scrollbar-thumb { background: var(--primary-yellow); border-radius: 10px; }

.achievement-popup-content h3 { font-size: 1.4em; color: #222; margin: 0 0 10px 0; }
.achievement-popup-content p { color: #666; margin-bottom: 15px; font-size: 0.95em; line-height: 1.5; }
.popup-icon { font-size: 4rem; color: #f0b90b; margin-bottom: 15px; }
.btn-popup { width: 100%; padding: 14px; background: linear-gradient(145deg, #f0b90b, #dca10a); color: #121212; border: none; border-radius: 12px; font-size: 1em; font-weight: bold; cursor: pointer; transition: all 0.3s; }
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1001; overflow: hidden; }
.confetti-emoji { position: absolute; top: -5vh; animation: fall 5s linear forwards; opacity: 1; }
@keyframes fall { to { transform: translateY(105vh) rotate(360deg); opacity: 0; } }
.notification-badge { position: absolute; top: -10px; right: -10px; background-color: var(--accent-red); color: white; border-radius: 50%; padding: 5px 10px; font-size: 12px; font-weight: bold; border: 2px solid var(--card-bg); }

/* Responsive */
@media (max-width: 900px) { .dashboard-split-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .navbar { flex-direction: column; align-items: flex-start; }
  .nav-links { flex-wrap: wrap; gap: 10px; margin-top: 15px; width: 100%; }
  .nav-links a { flex-grow: 1; text-align: center; }
  .form-box { margin: 40px auto; padding: 25px; }
  .form-row, .stats-grid, .history-grid-container { grid-template-columns: 1fr; }
  .chart-controls { flex-direction: column; align-items: stretch; }
  .chart-wrapper { aspect-ratio: 4 / 3; }
  .chart-grid .chart-wrapper { aspect-ratio: 4 / 3 !important; }
}
@media (min-width: 992px) { .chart-grid { grid-template-columns: 1fr 1fr; } .chart-grid .chart-wrapper { aspect-ratio: 1 / 1; } }
@media (max-width: 480px) {
  .container { padding: 10px; }
  .navbar h2 { font-size: 1.2rem; }
  .dashboard-header h1 { font-size: 1.8rem; }
  .user-stats-bar { flex-direction: column; gap: 15px; border-radius: 20px; padding: 15px; }
  .circular-loader { width: 120px; height: 120px; }
  .circular-loader::before { width: 90px; height: 90px; }
  .calendar-grid { gap: 3px; }
  .calendar-day { padding: 4px; min-width: 0; }
  .day-number { font-size: 0.8rem; }
  .day-hours { font-size: 0.8rem; }
}