:root {
  --primary: #5A45FF;
  --primary-light: #6F57FF;
  --bg: #F6F6FF;
  --card-bg: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #666;
  --success: #C6FF4A;
  --border-radius: 16px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(90, 69, 255, 0.15);
  --navbar-bg: #FFFFFF;
}

/* Dark theme */
body.dark-theme {
  --bg: #12121A;
  --card-bg: #1E1E2A;
  --text: #F5F5FF;
  --text-secondary: #B0B0C0;
  --navbar-bg: #1A1A24;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 24px rgba(90, 69, 255, 0.25);
}

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

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

.logo-top {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 24px 0 16px 0;
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 2px;
}

.pakers-topright {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7B5CFF;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transition: transform 160ms ease;
}

.pakers-topright:hover {
  transform: translateY(-1px);
}

.pakers-topright .letter-black {
  color: #1A1A1A;
}

.pakers-topright .letter-violet {
  color: #7B5CFF;
}

@media (max-width: 420px) {
  .pakers-topright {
    top: 12px;
    right: 12px;
    font-size: 22px;
    padding: 8px 12px;
  }
}

.navbar {
  background: var(--navbar-bg);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
  border-radius: 0 0 20px 20px;
  transition: background 0.3s ease;
}

.logo-header {
  height: 48px;
  width: auto;
  object-fit: contain;
  margin-right: 12px;
  border-radius: 0;
  transition: transform 0.2s ease;
}

.logo-header:hover {
  transform: scale(1.05);
}

.login-logo-img {
  height: 90px;
  width: auto;
  object-fit: contain;
  margin: 0 auto 12px auto;
  display: block;
  border-radius: 0;
}

body.dark-theme .logo-header,
body.dark-theme .login-logo-img {
  filter: none;
}

.theme-toggle {
  border: none;
  background: rgba(90, 69, 255, 0.12);
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.theme-toggle:hover {
  background: rgba(90, 69, 255, 0.22);
  transform: scale(1.05);
}

.logout-btn {
  border: none;
  background: transparent;
  color: #ff4b4b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255, 75, 75, 0.1);
}

.loading-state {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #e4e4ff 25%, #f4f4ff 50%, #e4e4ff 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: skeletonLoading 1.2s ease-in-out infinite;
  display: inline-block;
  min-width: 60px;
  min-height: 20px;
}

body.dark-theme .skeleton {
  background: linear-gradient(90deg, #2a2a3a 25%, #3a3a4a 50%, #2a2a3a 75%);
  background-size: 200% 100%;
}

@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.error-message {
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #d44;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 16px 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-message::before {
  content: '⚠️';
}

.status-message {
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.status-message.success {
  color: var(--primary);
}

.card, .zone-card, .session-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover, .zone-card:hover, .session-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

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

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.05s; }
.fade-in-delay-2 { animation-delay: 0.1s; }
.fade-in-delay-3 { animation-delay: 0.15s; }
.fade-in-delay-4 { animation-delay: 0.2s; }

.bar {
  transform-origin: bottom;
  transform: scaleY(0);
  animation: growBar 0.5s ease-out forwards;
}

.bar:nth-child(1) { animation-delay: 0.1s; }
.bar:nth-child(2) { animation-delay: 0.15s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.bar:nth-child(4) { animation-delay: 0.25s; }
.bar:nth-child(5) { animation-delay: 0.3s; }
.bar:nth-child(6) { animation-delay: 0.35s; }
.bar:nth-child(7) { animation-delay: 0.4s; }

@keyframes growBar {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.stat-card {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
}

/* Sticker/Doodle style icons */
.icon-sticker {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(108, 77, 255, 0.10);
  border: 2px solid rgba(108, 77, 255, 0.20);
  box-shadow: 0 10px 18px rgba(108, 77, 255, 0.12);
  transform: rotate(-3deg);
  transition: transform .15s ease, box-shadow .15s ease;
}

.icon-sticker svg,
.icon-sticker img {
  width: 22px;
  height: 22px;
}

.icon-sticker--lime {
  background: rgba(217, 255, 61, 0.18);
  border-color: rgba(217, 255, 61, 0.25);
  box-shadow: 0 10px 18px rgba(217, 255, 61, 0.10);
}

.icon-sticker--blue {
  background: rgba(79, 140, 255, 0.14);
  border-color: rgba(79, 140, 255, 0.22);
  box-shadow: 0 10px 18px rgba(79, 140, 255, 0.10);
}

.icon-sticker--orange {
  background: rgba(255, 140, 50, 0.14);
  border-color: rgba(255, 140, 50, 0.22);
  box-shadow: 0 10px 18px rgba(255, 140, 50, 0.10);
}

.stat-card:hover .icon-sticker,
.card:hover .icon-sticker,
.summary-card:hover .icon-sticker,
.best-zone-card:hover .icon-sticker {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 14px 24px rgba(108, 77, 255, 0.16);
}

/* Welcome banner with illustration */
.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.welcome-text {
  flex: 1;
}

.welcome-illu {
  flex: 0 0 auto;
}

.welcome-illu svg {
  filter: drop-shadow(0 10px 18px rgba(108, 77, 255, 0.25));
  transform: rotate(3deg);
  transition: transform 0.2s ease;
}

.welcome-banner:hover .welcome-illu svg {
  transform: rotate(0deg) scale(1.05);
}

/* Card illustration */
.card-illu {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.card-illu svg {
  filter: drop-shadow(0 6px 12px rgba(108, 77, 255, 0.2));
  transform: rotate(3deg);
  transition: transform 0.2s ease;
}

.best-zone-card:hover .card-illu svg {
  transform: rotate(0deg) scale(1.05);
}

.best-zone-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .welcome-illu svg {
    width: 60px;
    height: 60px;
  }
  
  .card-illu svg {
    width: 40px;
    height: 40px;
  }
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

.summary-card, .best-zone-card, .activity-card {
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
  animation-delay: 0.2s;
}

.zone-card, .session-card {
  opacity: 0;
  animation: fadeInUp 0.35s ease-out forwards;
}

.zone-card:nth-child(1), .session-card:nth-child(1) { animation-delay: 0.05s; }
.zone-card:nth-child(2), .session-card:nth-child(2) { animation-delay: 0.1s; }
.zone-card:nth-child(3), .session-card:nth-child(3) { animation-delay: 0.15s; }
.zone-card:nth-child(4), .session-card:nth-child(4) { animation-delay: 0.2s; }
.zone-card:nth-child(5), .session-card:nth-child(5) { animation-delay: 0.25s; }

.welcome-banner {
  background: linear-gradient(135deg, rgba(90, 69, 255, 0.08), rgba(198, 255, 74, 0.12));
  border-radius: 16px;
  padding: 20px 24px;
  margin: 20px 24px;
  color: var(--text);
}

.welcome-banner h1 {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.welcome-banner p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .welcome-banner {
    margin: 12px 16px;
    padding: 16px;
  }

  .welcome-banner h1 {
    font-size: 18px;
  }

  .welcome-banner p {
    font-size: 14px;
  }
}

.navbar .logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  margin-right: auto;
}

.nav-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(90, 69, 255, 0.1);
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(90, 69, 255, 0.15) 0%, rgba(111, 87, 255, 0.2) 100%);
  box-shadow: 0 2px 8px rgba(90, 69, 255, 0.15);
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.navbar .user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
  margin-left: 16px;
  box-shadow: 0 4px 16px rgba(90, 69, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 2px solid rgba(90, 69, 255, 0.3);
}

.navbar .user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(90, 69, 255, 0.6));
}

.navbar .user-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(90, 69, 255, 0.5);
}

.topbar {
  background: var(--card-bg);
  padding: 16px 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.topbar .avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  margin-bottom: 8px;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.header p {
  color: var(--text-secondary);
  margin-top: 4px;
}

h1, h2, h3 {
  color: var(--primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.icon-wrapper {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  background: rgba(111, 87, 255, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.icon-wrapper img {
  width: 28px;
  height: 28px;
}

.stat-card .icon-wrapper {
  width: 52px;
  height: 52px;
  min-width: 52px;
}

.stat-card .icon-wrapper img {
  width: 32px;
  height: 32px;
}

.stat-card .content {
  flex: 1;
}

.stat-card .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.stat-card .value.primary {
  color: var(--primary);
}

.stat-card .value.success {
  color: #10B981;
}

.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}

.card-header .badge {
  background: var(--primary);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.chart-placeholder {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 2px solid rgba(90, 69, 255, 0.1);
}

.bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 8px 8px 0 0;
  position: relative;
  min-height: 4px;
  transition: height 0.3s ease;
}

.bar::after {
  content: attr(data-day);
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.zones-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zone-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(90, 69, 255, 0.04) 0%, rgba(111, 87, 255, 0.08) 100%);
  border-radius: 12px;
  border: 1px solid rgba(90, 69, 255, 0.1);
  transition: transform 0.2s ease;
}

.zone-item:hover {
  transform: translateX(4px);
}

.zone-item .zone-name {
  font-weight: 700;
  color: var(--text);
}

.zone-item .zone-rate {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(90, 69, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary-card .icon-wrapper {
  background: rgba(255, 255, 255, 0.2);
}

.summary-card .content {
  flex: 1;
}

.summary-card .label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.summary-card .value {
  font-size: 36px;
  font-weight: 700;
}

.best-zone-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--success);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.best-zone-card .icon-wrapper {
  margin-top: 4px;
}

.best-zone-card .content h4 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.best-zone-card .zone-info {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.best-zone-card .zone-details {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

.activity-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  flex: 1;
}

.activity-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
}

.activity-item .activity-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: var(--primary);
  border-radius: 50%;
}

.activity-item .time {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 45px;
  font-weight: 500;
}

.activity-item .location {
  flex: 1;
  font-weight: 600;
  color: #333;
}

.activity-item .amount {
  font-weight: 700;
  color: var(--primary);
}

@media (max-width: 1200px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .sidebar > * {
    flex: 1;
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .navbar {
    padding: 10px 16px;
    gap: 4px;
    border-radius: 0 0 16px 16px;
  }

  .navbar .logo {
    font-size: 20px;
    margin-right: 8px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 12px;
    gap: 4px;
  }

  .nav-icon {
    width: 16px;
    height: 16px;
  }

  .navbar .user-avatar {
    width: 34px;
    height: 34px;
    margin-left: 8px;
    padding: 3px;
  }

  .dashboard {
    padding: 16px;
    gap: 16px;
  }

  .header h1 {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    flex-direction: column;
    gap: 10px;
  }

  .stat-card .icon-wrapper {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .stat-card .icon-wrapper img {
    width: 24px;
    height: 24px;
  }

  .stat-card .value {
    font-size: 22px;
  }

  .charts-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 16px;
  }

  .sidebar {
    flex-direction: column;
  }

  .sidebar > * {
    min-width: 100%;
  }

  .summary-card {
    padding: 20px;
  }

  .summary-card .value {
    font-size: 28px;
  }

  .best-zone-card {
    padding: 16px;
  }

  .activity-card {
    padding: 16px;
  }

  .activity-item {
    padding: 10px;
    gap: 8px;
  }

  .activity-item .time {
    min-width: 40px;
    font-size: 11px;
  }

  .activity-item .location {
    font-size: 13px;
  }

  .activity-item .amount {
    font-size: 14px;
  }

  .zone-item {
    padding: 14px;
  }

  .back-link {
    font-size: 14px;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 8px 12px;
  }

  .navbar .logo {
    font-size: 18px;
  }

  .nav-link {
    padding: 6px 8px;
    font-size: 11px;
  }

  .nav-link span {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    flex-direction: row;
    align-items: center;
  }

  .stat-card .icon-wrapper {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .dashboard {
    padding: 12px;
  }

  .summary-card {
    flex-direction: column;
    text-align: center;
  }

  .summary-card .icon-wrapper {
    margin: 0 auto;
  }
}
