/* Progress card - hele kortet er progressbaren */
.progress-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 0;
  /* spacing now handled by parent gap */
  margin-bottom: 0;
  border: 1px solid var(--border);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
  height: 60px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
  opacity: 0.9;
}

.progress-card:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Removed shimmer animation from progress card to avoid conflicts with progress bar animation */

/* Progress fill - den fargede delen som fyller kortet */
.progress-fill {
  height: 100%;
  background: var(--gradient-secondary);
  border-radius: 24px 0 0 24px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
  position: relative;
  overflow: hidden;
  /* Ensure initial state is 0% width for smooth animation */
  width: 0%;
  will-change: width;
}

/* Active progress fill - when nearing or completing goal */
.progress-fill.active {
  background: var(--gradient-secondary);
}

/* Initial loading state - ensures progress bar starts at 0% */
.progress-fill.loading {
  width: 0% !important;
  transition: none !important;
  animation: none !important;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0,0,0,0.03) 100%
  );
  border-radius: 0 24px 24px 0;
}

/* Removed progress bar shimmer to avoid conflicts with width animation */

/* Removed unused progressShimmer keyframe */

/* Confetti animation */
@keyframes confetti-fall {
  0% {
    transform: translateY(-10px) translateX(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(var(--end-x, 0px)) rotate(var(--rotation, 360deg)) scale(0.5);
    opacity: 0;
  }
}

.progress-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  /* Enhanced typography for better readability */
  color: var(--text-primary);
  font-size: var(--text-base); /* 16px - Slightly smaller for better balance */
  font-weight: var(--font-weight-semibold); /* 600 - Stronger emphasis for better visibility */
  font-family: var(--font-primary);

  /* Typography smoothing for crisp text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;

  /* Improved positioning and layout */
  pointer-events: none;
  white-space: nowrap;
  z-index: 4; /* Higher z-index to ensure visibility above progress fill effects */
  width: 100%;
  text-align: center;
  letter-spacing: 0.01em; /* Slight positive tracking for better readability at smaller size */
  line-height: 1.2; /* Tighter line height for better vertical centering */

  /* Enhanced text shadow for better contrast against varying backgrounds */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 0 8px rgba(0, 0, 0, 0.2);

  /* Smooth transitions for any text changes */
  transition: all var(--speed-normal) var(--ease-default);

  /* Ensure consistent rendering across browsers */
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.progress-fill.full {
  border-radius: 24px;
}

.progress-fill.full::before {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.08) 50%,
    transparent 100%
  );
}

.progress-fill.full::after {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(16,120,59,0.08) 100%
  );
}

/* Enhanced progress label states for better contrast optimization */
.progress-label.low-progress {
  /* When progress is low (0-25%), ensure good contrast against unfilled background */
  color: var(--text-primary);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 0 12px rgba(0, 0, 0, 0.3);
}

.progress-label.medium-progress {
  /* When progress is medium (25-75%), optimize for mixed background */
  color: var(--text-primary);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 0 8px rgba(0, 0, 0, 0.4),
    0 0 16px rgba(255, 255, 255, 0.1);
}

.progress-label.high-progress {
  /* When progress is high (75-100%), ensure visibility against filled background */
  color: #FFFFFF;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 0, 0, 0.2);
}

.progress-label.overachievement {
  /* Special styling for overachievement state with neon background */
  color: #FFFFFF;
  font-weight: var(--font-weight-bold); /* 700 - Extra emphasis for achievement */
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.7),
    0 0 12px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(58, 190, 246, 0.3);
  animation: subtle-glow 2s ease-in-out infinite alternate;
}

/* Subtle glow animation for overachievement text */
@keyframes subtle-glow {
  0% {
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.7),
      0 0 12px rgba(0, 0, 0, 0.5),
      0 0 24px rgba(58, 190, 246, 0.3);
  }
  100% {
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.7),
      0 0 12px rgba(0, 0, 0, 0.5),
      0 0 24px rgba(58, 190, 246, 0.5),
      0 0 32px rgba(58, 190, 246, 0.2);
  }
}

/* Overachievement styling - when goal is exceeded */
.progress-fill.overachievement {
  background: var(--gradient-neon);
}

/* Removed glowing border for overachievement - cleaner look */

@keyframes goalCelebrate {
  0% {
    filter: brightness(1.3);
  }
  50% {
    filter: brightness(1.4);
  }
  100% {
    filter: none;
  }
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-primary);
}

/* Base Body Styling with Inter optimizations */
body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-normal); /* 400 - Base text weight */
  font-size: var(--text-base);
  line-height: 1.6;
  letter-spacing: -0.01em; /* Slight negative tracking for Inter */
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Apply max-width only to specific elements that need it */
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

html {
  overflow: hidden; /* Completely prevent all scrolling */
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  /* Ensure browser chrome uses dark theme */
  color-scheme: dark;
}

/* Allow scrolling when auth forms are visible */
html:has(.auth-center),
html.auth-mode {
  overflow: auto;
}

body:has(.auth-center),
body.auth-mode {
  overflow: auto;
}

:root {
  /* Typography - Inter Font System */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;

  /* Font Weight Scale for Visual Hierarchy */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Font Sizes */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */

  /* Modern Dark Theme with Neon Blue - aligned with landing page */
  --primary: #4AC8FF;
  --primary-dark: #2A8FD6;
  --primary-light: #6AD4FF;
  --secondary: #00D4FF;
  --accent: #00F5FF;

  /* Semantic colors */
  --success: #00FF88;
  --warning: #FFB800;
  --error: #FF4757;
  --info: #3ABEF6;

  /* Background colors with improved integration */
  --bg-primary: #121212;
  --bg-secondary: rgba(26, 26, 26, 0.95);
  --bg-tertiary: rgba(30, 30, 30, 0.92);
  --bg-card: rgba(30, 30, 30, 0.85);
  --bg-hover: rgba(42, 42, 42, 0.9);

  /* Text colors with improved contrast */
  --text-primary: #FFFFFF;
  --text-secondary: #C0C0C0;
  --text-tertiary: #909090;
  --text-muted: #808080;

  /* Legacy support - map old colors to new system */
  --accent2: var(--primary);
  --accent3: var(--secondary);
  --accent4: var(--info);
  --accent-light: rgba(58, 190, 246, 0.1);
  --accent-alpha: rgba(58, 190, 246, 0.15);
  --accent2-alpha: rgba(58, 190, 246, 0.15);
  --accent3-alpha: rgba(0, 212, 255, 0.15);
  --accent4-alpha: rgba(58, 190, 246, 0.15);
  --danger: var(--error);

  /* Border colors */
  --border: #2a2a2f;
  --border-light: #3a3a3f;
  --border-color: var(--border);

  /* Shadow colors - removed for flat design */

  /* Glow effects removed */
  /* Spacing - 8px grid system */
  --space-1: 0.5rem;   /* 8px */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2rem;     /* 32px */
  --space-5: 2.5rem;   /* 40px */
  --space-6: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-10: 5rem;    /* 80px */
  --space-12: 6rem;    /* 96px */

  /* Animations - removed for flat design */
  --gradient-primary: linear-gradient(135deg,
    var(--accent) 0%,
    var(--accent3) 50%,
    var(--accent2) 100%);
  --gradient-secondary: linear-gradient(135deg,
    var(--accent-alpha) 0%,
    var(--accent3-alpha) 50%,
    var(--accent2-alpha) 100%);
  --gradient-progress-bg: linear-gradient(135deg,
    rgba(0, 245, 255, 0.08) 0%,
    rgba(0, 212, 255, 0.08) 50%,
    rgba(58, 190, 246, 0.08) 100%);
  --gradient-bg: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 25%, var(--bg-tertiary) 50%, var(--bg-card) 75%, var(--bg-secondary) 100%);
  --gradient-neon: linear-gradient(135deg, #3ABEF6 0%, #00D4FF 100%);
  --speed-fast: 0.15s;
  --speed-normal: 0.3s;
  --speed-slow: 0.5s;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --border-radius: 12px;
  --border-radius-large: 20px;
}

/* Typography Styles - Optimized for Inter */

/* Heading Styles */
h1 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold); /* 700 - Strong emphasis for main headings */
  font-size: var(--text-4xl);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

h2 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold); /* 600 - Moderate emphasis for subheadings */
  font-size: var(--text-3xl);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h4 {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

h5, h6 {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Body Text Variations */
p {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.6;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Small Text */
.text-small {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-tertiary);
}

/* Large Text */
.text-large {
  font-size: var(--text-lg);
  line-height: 1.6;
  font-weight: 400;
}

/* Numerical Data Styling (Perfect for Calculator) */
.number-display {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums; /* Monospaced numbers */
}

/* Form Labels */
label {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: var(--text-sm);
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.5rem;
}

/* Input Fields */
input, select, textarea {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Button Text */
button {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for interactive elements */
  font-size: var(--text-base);
  line-height: 1.5;
  letter-spacing: 0.025em; /* Positive tracking for better button readability */
}

/* Typography Utility Classes */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-muted { color: var(--text-muted) !important; }

.font-light { font-weight: var(--font-weight-light) !important; }
.font-normal { font-weight: var(--font-weight-normal) !important; }
.font-medium { font-weight: var(--font-weight-medium) !important; }
.font-semibold { font-weight: var(--font-weight-semibold) !important; }
.font-bold { font-weight: var(--font-weight-bold) !important; }
.font-extrabold { font-weight: var(--font-weight-extrabold) !important; }

.text-xs { font-size: var(--text-xs) !important; }
.text-sm { font-size: var(--text-sm) !important; }
.text-base { font-size: var(--text-base) !important; }
.text-lg { font-size: var(--text-lg) !important; }
.text-xl { font-size: var(--text-xl) !important; }
.text-2xl { font-size: var(--text-2xl) !important; }
.text-3xl { font-size: var(--text-3xl) !important; }
.text-4xl { font-size: var(--text-4xl) !important; }

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --text-4xl: 2rem;     /* 32px on mobile */
    --text-3xl: 1.75rem;  /* 28px on mobile */
    --text-2xl: 1.375rem; /* 22px on mobile */
  }

  body {
    font-size: var(--text-sm); /* Slightly smaller base on mobile */
  }

  .total-amount {
    font-size: 3rem; /* 48px on mobile - smaller than desktop but still prominent */
    font-weight: var(--font-weight-extrabold); /* Maintain maximum prominence on mobile */
    letter-spacing: -0.02em; /* Consistent letter spacing */
  }

  .total-label {
    font-weight: var(--font-weight-semibold); /* Consistent with desktop */
    letter-spacing: 0.025em; /* Maintain label styling */
    text-transform: uppercase;
  }

  .total-hours {
    font-weight: var(--font-weight-medium); /* Consistent with desktop */
    font-size: var(--text-base); /* 16px on mobile - appropriate for supporting text */
    letter-spacing: -0.005em;
    display: flex;
    align-items: center;
    gap: 6px; /* Space between icon and text */
    justify-content: center; /* Center the content horizontally */
  }

  /* Enhanced mobile progress label styling */
  .progress-label {
    font-size: var(--text-sm); /* 14px on mobile for better fit */
    font-weight: var(--font-weight-bold); /* 700 - Stronger weight for mobile visibility */
    letter-spacing: 0.02em; /* Slightly more tracking for mobile readability */

    /* Enhanced text shadow for mobile screens */
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.4),
      0 0 10px rgba(0, 0, 0, 0.3);
  }

  /* Mobile-specific progress label states */
  .progress-label.low-progress {
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.5),
      0 0 14px rgba(0, 0, 0, 0.4);
  }

  .progress-label.medium-progress {
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.6),
      0 0 10px rgba(0, 0, 0, 0.5),
      0 0 18px rgba(255, 255, 255, 0.15);
  }

  .progress-label.high-progress {
    text-shadow:
      0 1px 4px rgba(0, 0, 0, 0.7),
      0 0 12px rgba(0, 0, 0, 0.5),
      0 0 22px rgba(0, 0, 0, 0.3);
  }

  .progress-label.overachievement {
    font-weight: var(--font-weight-extrabold); /* 800 - Maximum emphasis on mobile */
    text-shadow:
      0 1px 4px rgba(0, 0, 0, 0.8),
      0 0 14px rgba(0, 0, 0, 0.6),
      0 0 26px rgba(58, 190, 246, 0.4);
  }
}

/* High DPI Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Performance optimizations for animations */
* {
  /* Optimize animations for better performance */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
}

/* Elements that will be animated should declare will-change */
.progress-fill,
.modal-content,
.shift-item,
.calendar-cell,
.btn,
.tab-btn {
  will-change: transform, opacity;
}

/* Force hardware acceleration for performance-critical elements */
.progress-fill,
.modal-content {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Remove will-change after animations complete */
.progress-fill[data-animating="false"],
.modal-content.modal-open,
.calendar-cell.animate-complete {
  will-change: auto;
}

/* Accessibility - Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Exception for progress bar animation - this is important for user feedback */
  .progress-fill {
    transition-duration: 0.8s !important;
  }

  /* Simplified progress label animations for reduced motion */
  .progress-label {
    transition: color 0.2s ease !important;
    animation: none !important;
  }

  .progress-label.overachievement {
    animation: none !important;
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.7),
      0 0 12px rgba(0, 0, 0, 0.5),
      0 0 24px rgba(58, 190, 246, 0.4);
  }

  /* Disable will-change for reduced motion */
  .progress-fill,
  .modal-content,
  .shift-item,
  .calendar-cell,
  .btn,
  .tab-btn {
    will-change: auto;
  }
}

/* Accessibility - Focus management */
.focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 9999;
  font-size: var(--text-sm);
  border: 1px solid var(--border-color);
}

.skip-link:focus {
  top: 6px;
}

@keyframes gradientSlide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Calendar cell animation - animate in row by row, left to right */
@keyframes calendarCellFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Special fade-in animation for week numbers */
@keyframes weekNumberFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Special animation for other-month cells */
@keyframes calendarCellFadeInOtherMonth {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.3;
  }
}

body {
  /* Simple top-to-bottom gradient: very dark at top, almost as dark at bottom */
  background: linear-gradient(to bottom,
    #0a0a0a 0%,     /* Very dark at top */
    #0c0c0c 100%    /* Almost as dark at bottom */
  );
  background-attachment: fixed;
  color: var(--text-primary);
  height: var(--app-height, 100vh);
  overflow: hidden;
  position: relative;
  /* Ensure browser chrome uses dark theme */
  color-scheme: dark;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.app-container {
  padding-left: 20px;
  padding-right: 20px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Mobile adjustments for app-container */
@media (max-width: 480px) {
  .app-container {
    padding-left: 10px;
    padding-right: 10px;
    max-width: 100%;
  }
}

.header {
  /* iOS-style translucent navigation bar with frosted glass effect */
  background: rgba(18, 18, 18, 0.75); /* Semi-transparent background to allow content to show through */
  backdrop-filter: blur(20px) saturate(180%); /* Enhanced blur with saturation for iOS-like effect */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 20px;
  border-bottom: 1px solid rgba(42, 42, 47, 0.6); /* More transparent border */
  border-radius: 0 0 24px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s var(--ease-default), opacity 0.3s var(--ease-default);
  overflow: visible;
  min-height: 80px; /* Fixed minimum height to prevent layout shift */
  flex-shrink: 0;
  z-index: 10000; /* Ensure header is above dashboard content */
  /* Ensure header and profile elements are immediately visible */
  opacity: 1 !important;
  visibility: visible !important;
}

.header.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* New header structure */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

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

/* Dashboard Toggle Button */
.dashboard-toggle-btn {
  background: rgba(18, 18, 18, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: none;
  border-radius: 16px;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
  margin-left: 8px;
}

.dashboard-toggle-btn:hover {
  background: rgba(18, 18, 18, 0.85);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Active state with enhanced 3D bevel effect */
.dashboard-toggle-btn.active {
  background: rgba(18, 18, 18, 0.85);
  color: var(--text-primary);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 0.13),
    inset 0 -2px 0 rgba(0, 0, 0, 0.23),
    inset 2px 0 0 rgba(255, 255, 255, 0.08),
    inset -2px 0 0 rgba(0, 0, 0, 0.13);
}

.toggle-text {
  display: block;
}

/* Dashboard View Toggle Styles */
.stats-view .dashboard-content {
  /* In stats view, restructure dashboard to show only stats */
  gap: 20px;
  margin-bottom: 32px;
}

/* Hide statistics section by default - only show stats card when Stats button is pressed */
.statistics-section {
  display: none !important;
}

/* Keep statistics section hidden in stats view since chart is moved to dashboard */
.stats-view .statistics-section {
  display: none;
}

/* Hide all original dashboard cards in stats view with smooth transition */
body.stats-view .dashboard-content .total-card,
body.stats-view .dashboard-content .next-shift-card,
body.stats-view .dashboard-content .next-payroll-card {
  display: none !important;
}

/* Add smooth transitions for dashboard cards */
.total-card,
.next-shift-card,
.next-payroll-card {
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Position month picker prominently in stats view */
.stats-view .dashboard-month-nav {
  order: 2; /* Position after stats container */
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex !important; /* Ensure visibility in stats view */
}

/* Move shifts section up in stats view */
.stats-view .shift-section {
  margin-top: -20px; /* Move up to reduce gap */
  padding-top: 20px;
}

/* Hide shift section month navigation in stats view to avoid duplication */
.stats-view .shift-section .month-navigation-container {
  display: none !important;
}

/* Enhanced stats view styling for better visual distinction */
.stats-view .dashboard-section {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 0 0 32px 32px;
  padding-bottom: 32px;
}

/* Dashboard stats container styling for stats view */
.dashboard-stats-container {
  order: 1;
  margin: 0;
  width: 100%;
  flex: 1;
  opacity: 0;
  transform: translateY(20px);
  animation: statsContainerFadeIn 0.4s ease-out forwards;
}

@keyframes statsContainerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure stats card maintains proper styling when moved to dashboard */
.stats-view .dashboard-stats-container .weekly-hours-chart-card {
  margin: 0;
  width: 100%;
  height: auto;
}

/* Ensure dashboard content uses flexbox ordering in stats view */
.stats-view .dashboard-content {
  display: flex;
  flex-direction: column;
}

/* Ensure proper spacing between dashboard and shifts in stats view */
.stats-view .dashboard-section {
  margin-bottom: 0; /* Remove bottom margin to reduce gap */
}

.stats-view .shift-section {
  padding-top: 10px; /* Reduce top padding for tighter layout */
}

.header-logo {
  width: 28px;
  height: 28px;
  filter: grayscale(100%);
}

.header-logo-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.header-logo-link:hover {
  opacity: 0.8;
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.header-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: var(--text-sm);
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
}

.header-back-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
  color: rgba(255, 255, 255, 0.9);
}

.header-back-btn svg {
  transition: color var(--speed-normal) var(--ease-default);
}

.header-back-btn:hover svg {
  color: rgba(99, 102, 241, 0.7);
}

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

.header h1 {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-primary);
}

/* User Profile Button and Dropdown */
.user-profile-container {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 10002; /* Ensure container is above all other elements */
  /* Ensure profile elements are immediately visible after greeting */
  opacity: 1 !important;
  visibility: visible !important;
}

.user-profile-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 24px; /* Pill-like appearance to complement circular profile icon */
  color: var(--text-primary);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium); /* 500 - Medium emphasis for secondary actions */
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
  min-width: auto;
  max-width: fit-content;
  min-height: 44px; /* Larger height to accommodate bigger icon */
}

.user-profile-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
  color: rgba(255, 255, 255, 0.9);
}

.user-nickname {
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for user identity */
  letter-spacing: 0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.profile-icon {
  stroke: var(--text-secondary);
  transition: all var(--speed-normal) var(--ease-default);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 6px;
  width: 32px !important; /* Override icon-sm class */
  height: 32px !important; /* Override icon-sm class */
  flex-shrink: 0;
}

.user-profile-btn:hover .profile-icon {
  stroke: rgba(99, 102, 241, 0.8);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  transform: scale(1.05);
}

/* Profile picture image in top bar */
.profile-picture-img {
  stroke: none !important; /* Remove stroke for images */
  padding: 0 !important; /* Remove any inherited padding */
  background: transparent !important; /* Remove background that might show through */
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-sizing: border-box !important; /* Ensure border is included in dimensions */
}

.user-profile-btn:hover .profile-picture-img {
  border-color: rgba(99, 102, 241, 0.6) !important;
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  z-index: 99999; /* Maximum z-index to ensure it's on top */
  min-width: 100%;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: all var(--speed-normal) var(--ease-default);
  pointer-events: none;
}

.profile-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium); /* 500 - Medium emphasis for menu items */
  cursor: pointer;
  transition: all var(--speed-fast) var(--ease-default);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.dropdown-item.logout-item {
  color: var(--danger);
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for destructive action */
}

.dropdown-item.logout-item:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ff6b6b;
}

/* Make SVG icons in top bar buttons grey */
.header-back-btn svg {
  stroke: var(--text-secondary);
}

/* Icon sizing classes */
.icon {
  width: 20px;
  height: 20px;
}

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

.icon-lg {
  width: 32px;
  height: 32px;
}

.header-info {
  display: flex;
  gap: 15px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  align-items: center;
  width: 100%;
  position: relative;
  overflow: visible; /* Change from hidden to visible to prevent clipping */
  height: 20px; /* Fixed height to prevent layout shift */
  flex-shrink: 0; /* Prevent shrinking */
}

.header-info span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Month navigation container - positioned above shift list */
.month-navigation-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  padding-top: 6px;
}

/* Hide shift section month navigation by default since we use dashboard navigation */
.shift-section .month-navigation-container {
  display: none !important;
}

/* Month navigation container when positioned in dashboard - UPDATED: Hidden by default, shown in stats view */
.dashboard-content .month-navigation-container {
  display: none !important; /* Hide dashboard navigation completely by default */
}

/* Show dashboard month navigation in stats view */
.stats-view .dashboard-content .month-navigation-container {
  display: flex !important; /* Show dashboard navigation in stats view */
}

/* Remove pseudo-elements approach and use direct spacing */
.dashboard-content .month-navigation-container::before,
.dashboard-content .month-navigation-container::after {
  display: none; /* Disable pseudo-element approach */
}

/* Ensure the month navigation itself doesn't grow */
.dashboard-content .month-navigation {
  flex: 0 0 auto;
}

.month-navigation {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 300;
}

/* Month navigation positioning - UPDATED: Always show in dashboard section underneath Next Payroll card
 *
 * UPDATED BEHAVIOR: Month picker consistently positioned underneath Next Payroll card in dashboard section
 * - Dashboard navigation: VISIBLE on all screen sizes as the single month picker instance
 * - Shift section navigation: HIDDEN on all screen sizes to avoid duplication
 * - Consistent positioning and functionality across all device types
 * - Maintains existing styling and responsive behavior within dashboard section
 */

/* Show dashboard month navigation on all screen sizes */
.dashboard-month-nav {
  display: flex !important;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 0;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Desktop and large screens - UPDATED: Always show dashboard navigation, hide shifts section navigation */
@media (min-width: 1024px) {
  .dashboard-month-nav {
    display: flex !important; /* Show dashboard navigation on all screen sizes */
  }

  /* Hide shift section navigation to avoid duplication */
  .shift-section .month-navigation-container {
    display: none;
  }
}

/* Large mobile devices in landscape - UPDATED: Always show shifts section navigation */
/* iPhone Pro Max landscape: viewport reports 439x956, but height (956) indicates landscape capability */
@media (orientation: landscape) and (min-height: 400px) and (max-width: 1023px) {
  .dashboard-month-nav {
    display: none; /* Hide dashboard navigation */
  }

  .shift-section .month-navigation-container {
    display: flex; /* Always show shifts section navigation */
  }
}

/* Large mobile portrait and tablet portrait - UPDATED: Always show shifts section navigation */
/* iPhone Pro Max portrait (439px) and larger devices */
@media (min-width: 430px) and (max-width: 1023px) and (orientation: portrait) {
  .dashboard-month-nav {
    display: none; /* Hide dashboard navigation */
  }

  .shift-section .month-navigation-container {
    display: flex; /* Always show shifts section navigation */
  }
}

/* Small mobile devices - always use dashboard navigation */
/* Portrait phones smaller than iPhone Pro Max and small landscape phones */
@media (max-width: 429px) {
  .dashboard-month-nav {
    display: flex !important;
    margin-top: 10px; /* Reduced spacing for small screens */
  }

  .dashboard-month-nav .month-navigation {
    border-radius: 12px;
    padding: 8px 12px; /* Smaller padding for small screens */
  }

  .dashboard-month-nav .month-display {
    min-width: 90px;
    font-size: 14px; /* Smaller font for small screens */
  }

  .dashboard-month-nav .month-nav-btn {
    width: 36px;
    height: 36px;
  }

  .dashboard-month-nav .month-nav-btn .icon-sm {
    width: 14px;
    height: 14px;
  }

  .shift-section .month-navigation-container {
    display: none;
  }

  /* AGGRESSIVE STAT CARD HEIGHT REDUCTION FOR SMALL PHONES */
  /* Reduce total-card dimensions significantly to fit small viewports */
  .total-card {
    padding: 14px 16px; /* Reduced from 30px to 14px vertical, 16px horizontal */
    border-radius: 20px; /* Slightly smaller radius */
    margin-bottom: 0;
  }

  /* Keep total amount readable on small screens */
  .total-amount {
    font-size: 3rem !important; /* 48px - maintain readability */
    font-weight: var(--font-weight-extrabold);
    letter-spacing: -0.02em;
    line-height: 1.1; /* Slightly tighter line height */
    margin-bottom: 10px; /* Reasonable margin */
  }

  /* Keep total label readable */
  .total-label {
    font-size: 12px !important; /* Readable label size */
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.025em;
    text-transform: uppercase;
    margin-bottom: 10px; /* Reasonable margin */
    line-height: 1.2;
  }

  /* Keep secondary info readable */
  .total-secondary-info {
    font-size: 15px !important; /* Readable secondary text */
    font-weight: var(--font-weight-medium);
    letter-spacing: -0.005em;
    line-height: 1.3;
    margin-top: 6px; /* Reasonable margin */
  }

  /* Ensure both amount and text have same size on mobile */
  .total-secondary-info .before-tax-text {
    font-size: 15px !important; /* Match parent size for mobile */
  }

  .total-secondary-info .bonus-amount {
    font-size: 15px !important; /* Match parent size for mobile */
  }

  /* Reduce dashboard content gaps and padding */
  .dashboard-content {
    padding-top: 10px; /* Reduced from 15px */
    padding-bottom: 10px;
    gap: 12px; /* Reduced from 20px */
  }

  /* Statistics section mobile optimization */
  .statistics-content {
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 12px;
  }

  /* AGGRESSIVE NEXT SHIFT CARD HEIGHT REDUCTION */
  .next-shift-card .shift-item {
    padding: 12px 14px; /* Reduced from 18px */
    border-radius: 20px; /* Slightly smaller radius */
    min-height: 65px; /* Reduced minimum height */
  }

  /* Keep next shift card text readable */
  .next-shift-card .shift-date {
    /* Font size now controlled by .shift-date-weekday rule */
    margin-bottom: 4px; /* Reasonable margin */
    line-height: 1.2;
  }

  .next-shift-card .shift-time {
    font-size: 14px; /* Readable time text */
    line-height: 1.3;
  }

  .next-shift-card .shift-total {
    font-size: 18px; /* Readable total amount */
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
  }

  .next-shift-card .shift-breakdown {
    font-size: 12px; /* Readable breakdown text */
    line-height: 1.2;
    margin-top: 3px;
  }

  /* AGGRESSIVE WEEKLY HOURS CHART HEIGHT REDUCTION */
  .weekly-hours-chart-card {
    padding: 10px; /* Reduced from 14px */
    border-radius: 18px; /* Slightly smaller radius */
    min-height: 180px; /* Significantly reduced from 220px */
  }

  .chart-cards-container {
    gap: 6px; /* Reduced gap */
  }

  .chart-visualization-card {
    padding: 8px; /* Reduced padding */
    border-radius: 10px; /* Smaller radius */
  }

  .chart-hours-section {
    width: 85px; /* Reduced width */
    gap: 4px; /* Reduced gap */
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 8px; /* Reduced padding */
    border-radius: 10px; /* Smaller radius */
  }

  /* Reduce chart text sizes */
  .hours-value-number,
  .shifts-count-number {
    font-size: 18px; /* Reduced from 20px */
    line-height: 1;
  }

  .hours-value-label,
  .shifts-count-label {
    font-size: 11px; /* Reduced from 12px */
    line-height: 1.1;
    margin-top: 1px;
  }

  /* Reduce chart bars height */
  .chart-bars {
    height: 100px; /* Reduced from 120px */
    gap: 2px; /* Reduced gap */
    padding: 8px 4px 4px 4px; /* Reduced padding */
  }

  .chart-content {
    gap: 6px; /* Reduced gap */
  }
}

/* EXTRA SMALL MOBILE DEVICES - Even more aggressive height reduction */
/* For very small phones like iPhone SE, older Android phones */
@media (max-width: 360px) {
  /* ULTRA-COMPACT STAT CARD STYLING */
  .total-card {
    padding: 12px 14px; /* Even more reduced padding */
    border-radius: 18px; /* Smaller radius */
  }

  /* Maintain readable total amount on very small screens */
  .total-amount {
    font-size: 2.75rem !important; /* 44px - still readable */
    line-height: 1; /* Reasonable line height */
    margin-bottom: 8px; /* Reasonable margin */
  }

  /* Maintain readable total label */
  .total-label {
    font-size: 11px !important; /* Readable label */
    margin-bottom: 8px; /* Reasonable margin */
    line-height: 1.2;
  }

  /* Maintain readable secondary info */
  .total-secondary-info {
    font-size: 14px !important; /* Readable secondary text */
    line-height: 1.3;
    margin-top: 5px;
  }

  /* Ensure both amount and text have same size on mobile */
  .total-secondary-info .before-tax-text {
    font-size: 14px !important; /* Match parent size for mobile */
  }

  .total-secondary-info .bonus-amount {
    font-size: 14px !important; /* Match parent size for mobile */
  }

  /* Ultra-compact dashboard spacing */
  .dashboard-content {
    padding-top: 8px; /* Minimal padding */
    padding-bottom: 8px;
    gap: 10px; /* Minimal gap */
  }

  /* Ultra-compact statistics spacing */
  .statistics-content {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 10px;
  }

  /* ULTRA-COMPACT NEXT SHIFT CARD */
  .next-shift-card .shift-item {
    padding: 10px 12px; /* Minimal padding */
    border-radius: 18px;
    min-height: 60px; /* Very compact height */
  }

  /* Maintain readable next shift text on very small screens */
  .next-shift-card .shift-date {
    /* Font size now controlled by .shift-date-weekday rule */
    margin-bottom: 3px;
  }

  .next-shift-card .shift-time {
    font-size: 13px;
  }

  .next-shift-card .shift-total {
    font-size: 17px;
  }

  .next-shift-card .shift-breakdown {
    font-size: 11px;
    margin-top: 2px;
  }

  /* ULTRA-COMPACT WEEKLY HOURS CHART */
  .weekly-hours-chart-card {
    padding: 8px; /* Minimal padding */
    border-radius: 16px;
    min-height: 160px; /* Very compact height */
  }

  .chart-cards-container {
    gap: 4px; /* Minimal gap */
  }

  .chart-visualization-card {
    padding: 6px; /* Minimal padding */
    border-radius: 8px;
  }

  .chart-hours-section {
    width: 75px; /* Very compact width */
    gap: 3px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 6px; /* Minimal padding */
    border-radius: 8px;
  }

  /* Ultra-compact chart text */
  .hours-value-number,
  .shifts-count-number {
    font-size: 16px; /* Very small numbers */
  }

  .hours-value-label,
  .shifts-count-label {
    font-size: 10px; /* Very small labels */
    margin-top: 0;
  }

  /* Ultra-compact chart bars */
  .chart-bars {
    height: 85px; /* Very compact height */
    gap: 1px; /* Minimal gap */
    padding: 6px 3px 3px 3px; /* Minimal padding */
  }

  .chart-content {
    gap: 4px; /* Minimal gap */
  }
}

/* SMALL MOBILE LANDSCAPE - Aggressive height reduction for rotated phones */
@media (max-width: 667px) and (orientation: landscape) and (max-height: 430px) {
  /* Landscape phones need even more aggressive space optimization */
  .total-card {
    padding: 10px 12px; /* Ultra-minimal padding for landscape */
    border-radius: 16px;
  }

  .total-amount {
    font-size: 2.5rem !important; /* 40px - readable even in landscape */
    line-height: 1;
    margin-bottom: 6px;
  }

  .total-label {
    font-size: 10px !important; /* Readable for landscape */
    margin-bottom: 6px;
    line-height: 1.1;
  }

  .total-secondary-info {
    font-size: 13px !important;
    line-height: 1.2;
    margin-top: 4px;
  }

  /* Ensure both amount and text have same size on mobile landscape */
  .total-secondary-info .before-tax-text {
    font-size: 13px !important; /* Match parent size for mobile landscape */
  }

  .total-secondary-info .bonus-amount {
    font-size: 13px !important; /* Match parent size for mobile landscape */
  }

  .dashboard-content {
    padding-top: 6px; /* Ultra-minimal for landscape */
    padding-bottom: 6px;
    gap: 8px; /* Very tight spacing */
  }

  /* Landscape statistics spacing */
  .statistics-content {
    padding-top: 6px;
    padding-bottom: 6px;
    gap: 8px;
  }

  /* Landscape next shift card */
  .next-shift-card .shift-item {
    padding: 8px 10px;
    border-radius: 16px;
    min-height: 50px; /* Very compact for landscape */
  }

  .next-shift-card .shift-date {
    /* Font size now controlled by .shift-date-weekday rule */
    margin-bottom: 2px;
  }

  .next-shift-card .shift-time {
    font-size: 12px;
  }

  .next-shift-card .shift-total {
    font-size: 16px;
  }

  .next-shift-card .shift-breakdown {
    font-size: 10px;
    margin-top: 1px;
  }

  /* Landscape weekly hours chart */
  .weekly-hours-chart-card {
    padding: 6px;
    border-radius: 14px;
    min-height: 140px; /* Very compact for landscape */
  }

  .chart-cards-container {
    gap: 3px;
  }

  .chart-visualization-card {
    padding: 5px;
    border-radius: 6px;
  }

  .chart-hours-section {
    width: 65px; /* Very compact for landscape */
    gap: 2px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 5px;
    border-radius: 6px;
  }

  .hours-value-number,
  .shifts-count-number {
    font-size: 14px; /* Very compact for landscape */
  }

  .hours-value-label,
  .shifts-count-label {
    font-size: 9px;
  }

  .chart-bars {
    height: 70px; /* Very compact for landscape */
    gap: 1px;
    padding: 4px 2px 2px 2px;
  }

  .chart-content {
    gap: 3px;
  }
}

/* Override for small landscape devices - still use shift section */
/* Small phones in landscape mode don't have enough effective space */
@media (orientation: landscape) and (max-height: 399px) {
  .dashboard-month-nav {
    display: none !important;
  }

  .shift-section .month-navigation-container {
    display: flex !important;
  }
}

/* Ensure portrait mode on small phones uses dashboard navigation */
/* Small phones in portrait mode (smaller than iPhone Pro Max) */
@media (orientation: portrait) and (max-width: 429px) {
  .dashboard-month-nav {
    display: flex !important;
  }

  .shift-section .month-navigation-container {
    display: none;
  }
}

/* Dashboard month navigation specific styling - positioned underneath Next Payroll card */
.dashboard-month-nav {
  /* Ensure proper spacing underneath Next Payroll card */
  margin-top: 16px;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.dashboard-month-nav .month-navigation {
  border-radius: 16px;
  padding: 12px 20px;
  transition: all 0.3s ease;
  background: rgba(18, 18, 18, 0.75); /* Match Next Payroll card styling */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: none;
  /* Subtle 3D Bevel Effect matching other cards */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    inset 1px 0 0 rgba(255, 255, 255, 0.05),
    inset -1px 0 0 rgba(0, 0, 0, 0.1);
}

.dashboard-month-nav .month-navigation:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 25px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    inset 1px 0 0 rgba(255, 255, 255, 0.07),
    inset -1px 0 0 rgba(0, 0, 0, 0.12);
}

/* Ensure month display text is properly styled in dashboard */
.dashboard-month-nav .month-display {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
  text-align: center;
}

/* Mobile and tablet dashboard month navigation styling */
@media (max-width: 1023px) {
  .dashboard-month-nav {
    margin-top: 12px; /* Slightly reduced spacing on mobile */
  }

  .dashboard-month-nav .month-navigation {
    border-radius: 14px;
    padding: 10px 16px;
  }

  .dashboard-month-nav .month-display {
    min-width: 100px;
    font-size: var(--text-base);
  }

  .dashboard-month-nav .month-nav-btn {
    width: 40px;
    height: 40px;
  }

  .dashboard-month-nav .month-nav-btn .icon-sm {
    width: 16px;
    height: 16px;
  }
}

/* Landscape-specific optimizations for mobile devices */
@media (orientation: landscape) and (min-height: 400px) and (max-width: 1023px) {
  .dashboard-month-nav {
    margin-top: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .dashboard-month-nav .month-navigation {
    padding: 8px 14px;
    border-radius: 12px;
  }
}

/* Desktop-range devices with moderate screen sizes */
@media (min-width: 1024px) and (max-width: 1200px) {
  .dashboard-month-nav {
    margin-top: 0; /* No margin - immediate positioning */
    padding-top: 6px; /* Ultra-minimal padding */
    padding-bottom: 6px; /* Ultra-minimal padding */
  }
}

/* Large desktop screens - optimize spacing for abundant screen real estate */
@media (min-width: 1201px) {
  .dashboard-month-nav {
    margin-top: 0; /* No margin - immediate positioning */
    padding-top: 4px; /* Ultra-minimal padding for maximum efficiency */
    padding-bottom: 4px; /* Ultra-minimal padding for maximum efficiency */
  }
}

/* JavaScript fallback - UPDATED: Always use dashboard navigation */
/* Maintain consistent behavior regardless of JavaScript state */
body.force-dashboard-nav .dashboard-month-nav {
  display: flex !important; /* Always show dashboard navigation */
}

body.force-dashboard-nav .shift-section .month-navigation-container {
  display: none !important; /* Hide shifts section navigation */
}

.month-nav-btn {
  /* Apply consistent button styling with circular shape - enlarged for better touch accessibility */
  background: var(--bg-tertiary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: var(--text-lg); /* Increased from text-base for better visibility */
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: all var(--speed-normal) var(--ease-default);
  width: 48px; /* Increased from 40px for better touch target */
  height: 48px; /* Increased from 40px for better touch target */
}

.month-nav-btn:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background-color: rgba(255, 255, 255, 0.02);
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.month-nav-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.month-display {
  font-size: var(--text-xl); /* Reduced by one standard size from text-2xl */
  font-weight: var(--font-weight-semibold); /* Increased from medium (500) to semibold (600) for better hierarchy */
  color: var(--text-primary);
  min-width: 130px; /* Reduced to accommodate smaller text */
  text-align: center;
  letter-spacing: -0.01em; /* Adjusted for smaller text size */
}

/* Larger icons for month navigation buttons to match increased button size */
.month-nav-btn .icon-sm {
  width: 20px; /* Increased from default 16px */
  height: 20px; /* Increased from default 16px */
}



/* Legacy month navigation styles - removed since navigation moved to floating action bar */



/* Forms */
.form-group {
  margin-bottom: 24px; /* Major spacing between form sections */
}

/* Form group labels - clear hierarchy */
.form-group label {
  display: block;
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: 8px; /* Comfortable spacing to related content */
  font-weight: 500;
}

/* Remove excessive top margin on tab content labels */
.tab-content label {
  margin-top: 0; /* Reset - spacing handled by form-group */
}

/* First form group in tab content - no extra spacing */
.tab-content > .form-group:first-child {
  margin-top: 0;
}

/* Add extra top margin to first form group in tab content for better separation */
.tab-content > .label:first-child {
  margin-top: 0px;
  padding-top: 0px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; /* Related spacing - components work together */
  margin-bottom: 0; /* No extra spacing - handled by form-group */
}

.form-control {
  background: var(--bg-tertiary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  color: var(--text-primary);
  font-size: var(--text-base); /* Prevents zoom on iOS */
  width: 100%;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  /* Optimized transitions - only animate specific properties */
  transition: border-color var(--speed-normal) var(--ease-default),
              box-shadow var(--speed-normal) var(--ease-default),
              background-color var(--speed-normal) var(--ease-default);
  appearance: none;
  min-height: 44px; /* Touch-friendly minimum */
  min-width: 44px;
}

select.form-control {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b6c9d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-control:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background-color: rgba(255, 255, 255, 0.02);
}

.form-control:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  background-color: rgba(255, 255, 255, 0.03);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 0 0 3px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.form-control:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Time Input Enhancements */
input[type="time"].form-control {
  position: relative;
}

/* Make placeholder text more visible for time inputs */
input[type="time"].form-control::-webkit-input-placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

input[type="time"].form-control::-moz-placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Add visual indicator for empty time inputs */
input[type="time"].form-control:invalid,
input[type="time"].form-control[value=""] {
  border-color: var(--warning);
  background-color: rgba(255, 184, 107, 0.05);
}

/* Add subtle animation to draw attention to empty time fields */
input[type="time"].form-control:invalid:focus,
input[type="time"].form-control[value=""]:focus {
  animation: subtle-pulse 2s ease-in-out infinite;
}

@keyframes subtle-pulse {
  0%, 100% { border-color: var(--warning); }
  50% { border-color: var(--accent); }
}

/* Direct time input styling */
.time-input {
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.time-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: normal;
}

.time-input:focus {
  text-align: center;
}

/* Time input validation styling */
.time-input:invalid {
  border-color: var(--warning);
  background-color: rgba(255, 184, 107, 0.05);
}

.time-input:invalid:focus {
  border-color: rgba(255, 107, 129, 0.6);
  background-color: rgba(255, 107, 129, 0.05);
}

/* Date Grid */
.date-grid {
  display: grid;
  grid-template-columns: 32px repeat(7, 1fr);
  gap: 2px;
  flex: 1;
}

.date-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  border-radius: 16px;
  padding: 4px 2px;
  cursor: pointer;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  text-align: center;
  min-height: 45px;
  transition: all var(--speed-fast) var(--ease-default); /* Changed from --speed-normal to --speed-fast */
  /* Initially hidden for animation */
  opacity: 0;
  animation: calendarCellFadeIn 0.2s var(--ease-default) forwards; /* Reduced from 0.3s */
}

.date-cell.selected {
  background: var(--accent3-alpha);
  color: var(--accent3);
  font-weight: 600;
}

.date-cell.disabled {
  background: var(--bg-secondary);
  opacity: 0.6;
  cursor: not-allowed;
  color: var(--text-tertiary);
}

/* Date cell content wrapper for blue dot positioning */
.date-cell-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Blue dot indicator for dates with shifts */
.shift-indicator-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--secondary);
  border-radius: 50%;
  border: 1px solid var(--bg-secondary);
  transition: all var(--speed-fast) var(--ease-default);
  z-index: 1;
}

/* Selected state adjustments for blue dot */
.date-cell.selected .shift-indicator-dot {
  background: white;
  border-color: var(--accent3-alpha);
}

/* Current date styling - very subtle highlight */
.date-cell.current-date {
  background: rgba(14, 165, 233, 0.08);
  border: 2px solid rgba(14, 165, 233, 0.2);
}

/* When current date is selected, maintain subtle highlight but blend with selection */
.date-cell.current-date.selected {
  background: var(--accent3-alpha);
  border: 2px solid rgba(14, 165, 233, 0.3);
  color: var(--accent3);
}

/* Week number styling */
.week-number {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 4px 2px;
  min-height: 45px;
  position: relative;
  transform: rotate(180deg);
}

.week-number.header {
  font-size: var(--text-xs);
  font-weight: 500;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  background: var(--bg-secondary);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 16px;
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for buttons */
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  /* Optimized transitions - only animate specific properties */
  transition: transform var(--speed-normal) var(--ease-default),
              background-color var(--speed-normal) var(--ease-default),
              box-shadow var(--speed-normal) var(--ease-default),
              opacity var(--speed-normal) var(--ease-default);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px; /* Touch-friendly minimum */
  min-width: 44px;
  line-height: 1;
  letter-spacing: 0.025em; /* Positive tracking for button text */
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
}

.btn:active {
  background-color: rgba(255, 255, 255, 0.05);
  transition-duration: 0.1s;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-primary);
  width: 100%;
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* Styling for tilbake-knapper */
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Settings modal button styling */
#settingsModal .btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
}

#settingsModal .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.3);
}

.btn-secondary svg {
  transition: transform var(--speed-normal) var(--ease-default);
}

.btn-secondary:hover svg {
  color: rgba(99, 102, 241, 0.6);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  margin-bottom: 20px;
  opacity: 0.6;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1200; /* Above backdrop but below dropdown */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

/* Special positioning for add shift modal to account for navigation header */
#addShiftModal.active {
  align-items: center !important;
  justify-content: center !important;
  padding-top: 0 !important;
  display: flex !important;
}

/* Mobile override for add shift modal positioning */
@media (max-width: 768px) {
  #addShiftModal.active {
    padding-top: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    display: flex !important;
  }
}

/* Desktop - center add shift modal within content viewport */
@media (min-width: 769px) {
  #addShiftModal.active {
    justify-content: center !important;
    align-items: center !important;
    padding-top: 0 !important;
    display: flex !important;
  }

  #addShiftModal .modal-content {
    margin: 0 auto;
    position: relative;
    max-width: 600px !important;
    width: min(90vw, 600px) !important; /* Constrain to content width */
    height: auto !important; /* Ensure height is not forced to 100vh */
  }
}

.modal-content {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 0;
  border-radius: 24px;
  max-width: 600px;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--border);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: gradientSlide 0.5s ease;
}

/* Desktop sizing - make modal not full screen on larger screens */
@media (min-width: 769px) {
  .modal-content {
    width: 90vw;
    height: auto;
    max-height: 90vh;
    margin: 0;
    border-radius: 24px;
  }
}

/* ADD SHIFT MODAL OVERRIDES - Must come after general modal rules */
/* Force add shift modal to be centered and fit content naturally */
#addShiftModal .modal-content {
  height: auto !important;
  width: min(90vw, 600px) !important;
  max-width: 600px !important;
  margin: 20px auto !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  /* Remove height constraints completely - let modal grow with content */
  max-height: none !important;
}

#addShiftModal .modal-body {
  flex: 1 !important;
  overflow-y: auto !important;
  padding-bottom: 80px !important; /* Provide space for fixed footer */
  /* Allow natural content sizing unless overflow occurs */
  max-height: none !important;
}

/* Ensure fixed footer doesn't interfere with content sizing */
#addShiftModal .modal-fixed-footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

@media (min-width: 769px) {
  #addShiftModal .modal-content {
    height: auto !important;
    width: min(90vw, 600px) !important;
    max-width: 600px !important;
    margin: 20px auto !important;
    /* Remove height constraints to allow modal to grow with content */
    max-height: none !important;
  }
}

@media (max-width: 768px) {
  #addShiftModal .modal-content {
    height: auto !important;
    width: 100vw !important;
    margin: 10px 0 !important;
    /* Remove height constraints to allow modal to grow with content */
    max-height: none !important;
  }
}

/* Center settings modal on screen */
#settingsModal.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#settingsModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1300;
  max-width: 520px;
  width: 92vw;
  height: 85vh;
  max-height: 700px;
  min-height: 500px;
  overflow: hidden;
  border-radius: 24px;
  border: 2px solid var(--border);
}

@media (max-width: 600px) {
  #settingsModal .modal-content {
    width: 95vw;
    height: 90vh;
    max-height: 650px;
    min-height: 450px;
    border-radius: 24px;
  }

  /* Medium screen settings modal footer */
  #settingsModal .modal-fixed-footer {
    padding: 14px 20px;
  }
}

@media (max-width: 480px) {
  #settingsModal .modal-content {
    width: 98vw;
    height: 92vh;
    max-height: 600px;
    min-height: 400px;
    border-radius: 24px;
  }

  /* Mobile specific settings modal footer */
  #settingsModal .modal-fixed-footer {
    padding: 12px 16px;
  }
}

/* Fixed viewport-based height for settings modal */
#settingsModal .modal-content {
  display: flex;
  flex-direction: column;
}

/* Tab content wrapper for scrolling */
#settingsModal .tab-content-wrapper {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 80px; /* Add space for fixed footer */
}

/* Settings modal specific fixed footer positioning */
#settingsModal .modal-fixed-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: var(--bg-card);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20; /* Higher than general modal content */
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Tab content with consistent, hierarchical padding */
#settingsModal .tab-content {
  padding: 24px 20px 20px 20px; /* Generous top padding, consistent sides */
}

/* Hide scrollbars in modals while keeping scroll functionality */
.modal-content {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.modal-content::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

/* Hide scrollbars in breakdown modal */
.breakdown-modal-custom::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

/* Profile Modal Styling */
#profileModal.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#profileModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1300;
  max-width: 480px;
  width: 92vw;
  height: auto;
  max-height: 80vh;
  min-height: 400px;
  overflow: hidden;
  border-radius: 24px;
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
}

#profileModal .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 20px;
  padding-bottom: 80px; /* Add space for fixed footer */
}

#profileModal .modal-fixed-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  #profileModal .modal-content {
    width: 95vw;
    max-height: 85vh;
    min-height: 350px;
    border-radius: 24px;
  }

  #profileModal .modal-fixed-footer {
    padding: 14px 20px;
  }
}

@media (max-width: 480px) {
  #profileModal .modal-content {
    width: 98vw;
    max-height: 90vh;
    min-height: 300px;
    border-radius: 24px;
  }

  #profileModal .modal-fixed-footer {
    padding: 12px 16px;
  }
}

.modal-close {
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--speed-normal) var(--ease-default);
}

.modal-close svg {
  fill: var(--text-secondary);
  stroke: var(--text-secondary);
  transition: all var(--speed-normal) var(--ease-default);
}

.modal-close:hover {
  color: rgba(99, 102, 241, 0.7);
  background-color: rgba(255, 255, 255, 0.03);
}

.modal-close:hover svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* Tabs */
.tab-nav {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--border-radius) var(--border-radius);
  padding: 4px;
  gap: 4px;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium); /* 500 - Moderate emphasis for tabs */
  border-radius: 16px;
  transition: all var(--speed-normal) var(--ease-default);
  position: relative;
  letter-spacing: 0.01em; /* Slight positive tracking for tab readability */
}

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

.tab-btn.active {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for active tabs */
  border: 1px solid var(--border);
  letter-spacing: 0.015em; /* Slightly more tracking for active state */
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* View toggle in shift section */
.view-toggle {
  margin-left: auto;
  margin-right: 12px;
}

.view-toggle .tab-btn {
  padding: 8px 12px;
  font-size: var(--text-xs);
}

/* Calendar display toggle */
.calendar-display-toggle {
  display: flex;
  justify-content: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: transparent;
}

.calendar-toggle-nav {
  display: flex;
  background: rgba(26, 26, 29, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4px;
  gap: 4px;
  flex-shrink: 0;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.calendar-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 24px;
  transition: all var(--speed-normal) var(--ease-default);
  position: relative;
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
}

.calendar-toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.calendar-toggle-btn.active {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-weight: 600;
  border: 1px solid var(--border);
}

/* Calendar hours display styling */
.calendar-hours-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 100%;
  padding: 0;
  margin: 0;
}

.calendar-hours-total {
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(9px, 2.5vw, 12px);
  text-align: left !important;
  line-height: 1.2;
  width: auto;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
  white-space: pre;
  padding: 0 2px 0 0 !important;
  margin: 0 !important;
  display: block;
  letter-spacing: 0;
  position: relative;
  left: 0;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
}

/* Balanced sizing for shift calendar hours totals */
.shift-calendar .calendar-hours-total {
  font-size: clamp(10px, 2.8vw, 13px);
}

/* Override centering for calendar cells in hours mode */
.calendar-cell.hours-mode {
  align-items: flex-start;
  text-align: left;
  padding: 8px 4px 8px 4px;
}

.calendar-cell.hours-mode .calendar-cell-content {
  align-items: flex-start;
  padding: 0;
  width: 100%;
}

.calendar-cell.hours-mode .calendar-day-number {
  text-align: center;
  width: 100%;
}

.calendar-cell.hours-mode .calendar-shift-data {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Ensure time lines are left-aligned relative to each other within the centered container */
.calendar-cell.hours-mode .calendar-hours-total {
  text-align: left !important;
  justify-self: center;
  align-self: center;
}

/* Responsive adjustments for calendar toggle */
@media (max-width: 768px) {
  .calendar-display-toggle {
    padding: 12px 16px;
  }

  .calendar-toggle-btn {
    padding: 6px 12px;
    font-size: var(--text-xs);
    min-width: 70px;
  }
}

/* Recurring Feature Introduction Modal */
#recurringIntroModal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#recurringIntroModal .modal-content {
  max-width: 520px;
  width: 90vw;
  max-height: 85vh;
  height: auto;
  border: 2px solid var(--accent);
  text-align: center;
  overflow-y: auto;
  margin: 0;
}

/* Mobile specific adjustments for recurring intro modal */
@media (max-width: 768px) {
  #recurringIntroModal {
    padding: 16px;
  }

  #recurringIntroModal .modal-content {
    width: 95vw;
    max-height: 80vh;
    border-radius: 24px;
  }
}

#recurringIntroModal .modal-title {
  font-size: var(--text-xl);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

#recurringIntroModal .modal-body {
  text-align: center;
}

#recurringIntroModal .modal-body h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

#recurringIntroModal .modal-body ul {
  color: var(--text-secondary);
  text-align: left;
  display: inline-block;
  margin: 0 auto;
}

#recurringIntroModal .modal-body ul li {
  margin-bottom: 4px;
}

#recurringIntroModal .modal-body p {
  text-align: center;
}

#recurringIntroModal .modal-body > div {
  text-align: center;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: all var(--speed-normal) var(--ease-default);
  border-radius: 20px;
}

.slider:hover {
  background-color: rgba(99, 102, 241, 0.3);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: var(--bg-primary);
  transition: .4s;
  border-radius: 50%;
}

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

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

/* Switch Group - for proper alignment of toggles */
.switch-group {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px; /* Comfortable spacing between text and toggle */
  min-height: auto;
  margin-bottom: 8px; /* Close spacing - part of form group */
}

.switch-group span {
  flex: 1;
  line-height: 1.4;
}

.switch-group .switch {
  flex-shrink: 0;
  margin-top: 2px; /* Slight visual alignment adjustment */
}

/* Form hint for compact info */
.form-hint {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-tertiary);
  opacity: 0.8;
  margin-top: 4px; /* Tight spacing - directly related to input above */
  line-height: 1.4;
}

/* Form groups with hints should still have proper spacing */
.form-group:has(.form-hint) {
  margin-bottom: 24px; /* Maintain consistent major spacing */
}

/* Alternative approach for browsers that don't support :has() */
.form-group-with-hint {
  margin-bottom: 24px;
}

/* Compact buttons in settings */
.tab-content .btn {
  padding: 8px 16px;
  font-size: var(--text-sm);
  margin-top: 0; /* Reset - spacing handled by parent */
}

/* Bonus Slots */
.bonus-slots {
  display: flex;
  flex-direction: column;
  gap: 8px; /* Close spacing - related components */
  margin-bottom: 12px; /* Related spacing before buttons */
}

.bonus-slot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.time-input-group,
.rate-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.time-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
}

.bonus-slot .form-control {
  margin: 0;
}

.bonus-slot .remove-bonus {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all var(--speed-fast);
  font-size: 18px;
  line-height: 1;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bonus-slot .remove-bonus:hover {
  background: rgba(255, 107, 129, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

/* Info Box */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, var(--shadow-accent), rgba(124, 58, 237, 0.1));
  border: 1px solid;
  border-image: linear-gradient(135deg, var(--accent), var(--accent2)) 1;
  border-radius: 16px;
  padding: 12px 16px; /* Comfortable internal spacing */
  margin-bottom: 20px; /* Major spacing - important content */
}

.info-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.info-content {
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-primary);
}

.info-content strong {
  color: var(--accent);
}

/* Shift Toggle */
.add-shift-button {
  background: var(--gradient-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 24px;
  margin: 0 0 20px 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all var(--speed-normal) var(--ease-default);
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for action buttons */
  width: 100%;
  letter-spacing: 0.025em; /* Positive tracking for action buttons */
  text-transform: uppercase; /* Modern action button styling */
}

.add-shift-button:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
  color: rgba(255, 255, 255, 0.85);
}

.add-shift-button:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.add-shift-button .icon {
  width: 20px;
  height: 20px;
}

/* Shift List */
.shift-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Week separator for shift list */
.week-separator {
  display: flex;
  align-items: center;
  margin: 16px 0 8px 0;
  position: relative;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.02) 60%,
    rgba(255, 255, 255, 0.01) 80%,
    transparent 100%
  );
  border-radius: 12px;
  padding: 8px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}



.week-separator-line {
  flex: 1;
  height: 1px;
  background: transparent;
  position: relative;
}

.week-separator-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  padding: 0 16px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.week-separator-content .week-separator-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-separator-content .week-separator-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-separator-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.week-separator-week {
  font-weight: 600;
  color: var(--text-primary);
}

.week-separator-total {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 16px;
  letter-spacing: -0.02em;
}

@media (max-width: 480px) {
  .week-separator {
    margin: 12px 0 6px 0;
  }

  .week-separator-content {
    padding: 0 12px;
    font-size: 13px;
  }

  .week-separator-arrow {
    width: 14px;
    height: 14px;
  }

  .week-separator-total {
    font-size: 14px;
  }

  .week-number-on-separator {
    font-size: 12px;
    padding: 3px 10px;
  }
}

.shift-item {
  /* iOS-style translucent background matching header, total card, and chart card */
  background: rgba(18, 18, 18, 0.75); /* Semi-transparent background to allow content to show through */
  backdrop-filter: blur(20px) saturate(180%); /* Enhanced blur with saturation for iOS-like effect */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: none; /* Remove border for consistent bevel effect */
  border-radius: 24px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--speed-normal) var(--ease-default);
  min-height: 80px;
  /* Subtle 3D Bevel Effect - consistent with all cards */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15), /* Existing depth shadow */
    inset 0 1px 0 rgba(255, 255, 255, 0.1), /* Subtle top inner highlight */
    inset 0 -1px 0 rgba(0, 0, 0, 0.2), /* Subtle bottom inner shadow */
    inset 1px 0 0 rgba(255, 255, 255, 0.05), /* Subtle left inner highlight */
    inset -1px 0 0 rgba(0, 0, 0, 0.1); /* Subtle right inner shadow */
  opacity: 0.9;
}

.shift-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px; /* Restore original gap */
}

.shift-date {
  font-weight: var(--font-weight-semibold); /* 600 - Same as stat-value for consistency */
  margin-bottom: 0; /* Remove margin to rely on gap for spacing */
  font-size: var(--text-lg); /* 18px - Same size as stat-value */
  color: var(--text-primary);
  line-height: 1.2; /* Match line-height with shift-total */
  letter-spacing: -0.005em; /* Subtle negative tracking */
  display: flex;
  align-items: center;
}

.shift-date-number {
  flex-shrink: 0;
}

.shift-date-separator {
  margin: 0 6px;
}

.shift-date-separator::before {
  content: '•';
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: bold;
}

/* Hide bullet point for next shift cards since they use conditional date display */
.next-shift-card .shift-date-separator::before {
  content: '';
}

/* Increase font size of date display text to match payroll countdown text */
.next-shift-card .shift-date-weekday {
  font-size: var(--text-lg); /* 18px - Same as payroll countdown text */
  font-weight: var(--font-weight-semibold); /* 600 - Maintain visual hierarchy */
}

/* Add consistent spacing between date and countdown text */
.next-shift-card .shift-countdown-timer {
  margin-left: 8px; /* Consistent spacing between date and countdown */
}

/* Color weekday text to match left border colors for Saturday and Sunday shifts */
.shift-item.saturday .shift-date-weekday {
  color: var(--accent3);
  font-weight: 600;
}

.shift-item.sunday .shift-date-weekday {
  color: var(--accent2);
  font-weight: 600;
}

/* Current date styling for shift items - matches calendar current date styling */
.shift-item.current-date {
  background: rgba(14, 165, 233, 0.06) !important;
  border: 2px solid rgba(14, 165, 233, 0.15) !important;
}

.shift-details {
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-normal); /* 400 - General text weight */
  color: var(--text-secondary);
  letter-spacing: -0.005em; /* Subtle negative tracking for better readability */
  line-height: 1.3; /* Consistent line-height for alignment with shift-breakdown */
}

.shift-time-with-hours {
  display: flex;
  align-items: center;
  gap: 5px;
}

.shift-time-arrow {
  margin: 0 8px;
  font-weight: bold;
  color: var(--text-secondary);
}

.shift-details > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.shift-type {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: var(--text-xs);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 500;
}

.shift-type.saturday {
  background: var(--accent3);
  color: var(--bg-primary);
}

.shift-type.sunday {
  background: var(--accent2);
  color: var(--bg-primary);
}

.shift-amount {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: 16px;
  flex-shrink: 0;
}

.shift-amount-wrapper {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px; /* Increase gap to match shift-info for alignment */
  margin-left: 16px;
  flex-shrink: 0;
}

.shift-total {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold); /* 700 - Strong emphasis for shift amounts */
  color: var(--text-primary);
  line-height: 1.2;
  opacity: 0.8;
  letter-spacing: -0.01em; /* Slight negative tracking for numbers */
}

.shift-breakdown {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-tertiary);
  white-space: nowrap;
  line-height: 1.3; /* Match line-height with shift-details for alignment */
}

.shift-actions {
  display: flex;
  gap: 8px;
  align-self: center;
  flex-shrink: 0;
}

/* Login / Registration */
.login-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: 16px;
  padding: 32px 28px 24px 28px;
  max-width: 350px;
  width: 100%;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  /* Ensure card doesn't exceed viewport height and is always accessible */
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  /* Ensure minimum spacing from viewport edges */
  min-height: fit-content;
}

/* Responsive adjustments for login card */
@media (max-height: 600px) {
  .login-card {
    padding: 24px 20px 20px 20px;
    max-height: calc(100vh - 20px);
  }

  .login-card h2 {
    margin-bottom: 16px;
    font-size: 20px;
  }
}

@media (max-height: 500px) {
  .login-card {
    padding: 20px 16px 16px 16px;
    border-radius: 12px;
  }

  .login-card h2 {
    margin-bottom: 12px;
    font-size: 18px;
  }

  .login-card .form-control {
    margin-bottom: 8px;
  }

  .login-card .btn {
    padding: 10px 0;
    font-size: 15px;
  }
}

.login-card h2 {
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: 20px;
}

.login-card .btn {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for login actions */
  border-radius: 16px;
  padding: 12px 0;
  width: 100%;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
  border: none;
  letter-spacing: 0.025em; /* Positive tracking for button text */
  text-transform: uppercase; /* Modern button styling */
}

.login-card .btn-primary:hover,
.login-card .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Center crop modal within available viewport space */
#cropModal.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  /* Account for header height and floating action bar */
  padding: 80px 20px 100px 20px;
}

/* Desktop crop modal positioning - center within content area */
@media (min-width: 769px) {
  #cropModal.active {
    padding: 40px 20px 40px 20px;
  }

  #cropModal .modal-content {
    /* Ensure modal is properly constrained on desktop */
    max-height: calc(100vh - 200px);
    min-height: 500px;
  }
}

/* Center for auth modals - fixed positioning for laptops */
.auth-center {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  min-height: 100vh;
  box-sizing: border-box;
  /* Ensure form stays within viewport bounds */
  overflow-y: auto;
}

/* Responsive adjustments for smaller screens */
@media (max-height: 600px) {
  .auth-center {
    padding: 15px;
  }
}

@media (max-height: 500px) {
  .auth-center {
    padding: 10px;
  }
}

/* Preset Badge */
.preset-badge {
  display: inline-block;
  background: var(--accent3);
  color: var(--bg-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  margin-left: 10px;
}

/* Series Badge */
.series-badge {
  display: inline-block;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
  margin-left: 8px;
  vertical-align: middle;
}

/* Content section with proper spacing from header */
.content {
  padding-top: 0;
}

/* Overview Section Adjustments */
.total-card {
  /* iOS-style translucent background matching header */
  background: rgba(18, 18, 18, 0.75); /* Semi-transparent background to allow content to show through */
  backdrop-filter: blur(20px) saturate(180%); /* Enhanced blur with saturation for iOS-like effect */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  padding: 30px;
  text-align: center;
  /* spacing now handled by parent gap */
  margin-bottom: 0;
  border: none; /* Remove border/outline */
  /* Subtle 3D Bevel Effect - refined raised appearance */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15), /* Existing depth shadow */
    inset 0 1px 0 rgba(255, 255, 255, 0.1), /* Subtle top inner highlight */
    inset 0 -1px 0 rgba(0, 0, 0, 0.2), /* Subtle bottom inner shadow */
    inset 1px 0 0 rgba(255, 255, 255, 0.05), /* Subtle left inner highlight */
    inset -1px 0 0 rgba(0, 0, 0, 0.1); /* Subtle right inner shadow */
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
}

.total-card:hover {
  background-color: rgba(255, 255, 255, 0.02);
  transform: translateY(-2px);
  /* Subtle 3D Bevel Effect on hover - refined appearance */
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.18), /* Enhanced depth shadow */
    inset 0 2px 0 rgba(255, 255, 255, 0.13), /* Refined top inner highlight */
    inset 0 -2px 0 rgba(0, 0, 0, 0.23), /* Refined bottom inner shadow */
    inset 2px 0 0 rgba(255, 255, 255, 0.08), /* Refined left inner highlight */
    inset -2px 0 0 rgba(0, 0, 0, 0.13); /* Refined right inner shadow */
}

.total-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  /* Replaced: animation: shimmer-once 0.8s linear 0.5s forwards; */
  animation-name: shimmer-once;
  animation-duration: 0.8s;
  animation-timing-function: linear;
  animation-delay: 0.5s;
  animation-fill-mode: forwards;
  animation-iteration-count: 1; /* Explicitly setting default */
  animation-direction: normal; /* Explicitly setting default */
  animation-play-state: running; /* Explicitly setting default */
}

@keyframes shimmer-once {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Calendar shimmer animations - text-based shimmer without layout changes */
.calendar-total {
  /* Reset all possible styling to ensure no layout changes */
  all: unset;
  /* Only keep the essential text properties */
  font: inherit;
  color: inherit;
}

.calendar-total.shimmer {
    background: linear-gradient(90deg, currentColor 0%, rgba(255,255,255,0.8) 50%, currentColor 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 2s ease-in-out forwards;
  }

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

.total-label {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold); /* 600 - Subtle emphasis for section labels */
  margin-bottom: 16px; /* Increased from 10px to 16px for better visual separation */
  letter-spacing: 0.025em; /* Slight positive tracking for labels */
  text-transform: uppercase; /* Modern label styling */
}

.total-amount {
  font-size: 3.5rem; /* 56px - More balanced size, less cartoonish */
  font-weight: var(--font-weight-extrabold); /* 800 - Maximum prominence for total pay */
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  line-height: 1.1;
  margin: 8px 0; /* Add some vertical spacing to accommodate larger size */
  letter-spacing: -0.02em; /* Tighter letter spacing for large amounts */
}

.total-secondary-info {
  color: var(--text-primary); /* White color to match progress label */
  font-size: var(--text-lg); /* 18px - same size as progress label */
  font-weight: var(--font-weight-medium); /* 500 - Supporting text weight */
  margin-top: 10px;
  letter-spacing: -0.005em; /* Subtle negative tracking */
  display: flex;
  justify-content: center; /* Center the content under main amount */
  text-align: center;
}

.secondary-info-content {
  display: flex;
  align-items: baseline; /* Align text elements by their baselines (bottom of text) */
  gap: 8px; /* Space between amount and descriptive text */
}

.total-secondary-info .before-tax-text {
  font-size: var(--text-lg); /* Match the parent font size for proper baseline alignment */
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
}

.total-secondary-info .bonus-amount {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}











/* Backdrop blur effect */
.backdrop-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-default);
  cursor: pointer;
}

.backdrop-blur.active {
  opacity: 1;
  pointer-events: auto;
}

/* Header hiding animation when breakdown is open */
.header.hidden {
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease-default);
}



/* Breakdown calendar styles */
.breakdown-calendar {
  opacity: 0;
  animation: fadeIn 0.6s var(--ease-default) 0.3s forwards;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
}

.calendar-header {
  display: grid;
  grid-template-columns: 32px repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px; /* Reduced from 12px to bring week letters closer to top-cells */
  width: 100%;
  box-sizing: border-box;
  align-items: center; /* Vertically center week letters and week number header */
  padding: 0 20px;
}

/* Special header layout for shift calendar */
.shift-calendar .calendar-header {
  grid-template-columns: repeat(7, 1fr);
  padding: 0 20px;
  gap: 1px;
}

.calendar-day-header {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 2px 2px; /* Reduced vertical padding for tighter spacing */
}

/* Default calendar grid for stat cards (breakdown calendar) */
.breakdown-calendar .calendar-grid {
  display: grid;
  grid-template-columns: 32px repeat(7, 1fr);
  grid-auto-rows: minmax(45px, auto);
  gap: 2px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px;
}

/* Shift calendar grid - uses separate week grids, no week numbers in grid */
.shift-calendar .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(45px, auto);
  gap: 1px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px;
}

.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 8px 2px 8px 2px;
  font-size: 12px;
  transition: all 0.2s var(--ease-default); /* Reduced from 0.3s */
  position: relative;
  min-height: 45px;
  text-align: center;
  outline: none;
  /* Initially hidden for animation */
  opacity: 0;
  animation: calendarCellFadeIn 0.2s var(--ease-default) forwards; /* Reduced from 0.3s */
}

.calendar-cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  width: 100%;
  height: 100%;
}



.calendar-cell.other-month {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  /* Use special animation that ends with opacity 0.3 */
  animation: calendarCellFadeInOtherMonth 0.3s var(--ease-default) forwards;
}

/* Current date styling for calendar cells - very subtle highlight */
.calendar-cell.current-date {
  background: rgba(14, 165, 233, 0.06) !important;
  border: 2px solid rgba(14, 165, 233, 0.15) !important;
}

/* When current date has shifts, maintain subtle highlight but blend with shift styling */
.calendar-cell.current-date.has-shifts {
  background: var(--gradient-secondary) !important;
  border: 2px solid rgba(14, 165, 233, 0.25) !important;
}

/* When current date is empty (no shifts), ensure current-date styling takes precedence */
.calendar-cell.current-date.empty-date {
  background: rgba(14, 165, 233, 0.06) !important;
  border: 2px solid rgba(14, 165, 233, 0.15) !important;
}

/* Calendar week number styling */
.calendar-week-number {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  writing-mode: horizontal-tb;
  text-orientation: initial;
  padding: 4px 2px;
  min-height: 45px;
  opacity: 0;
  animation: weekNumberFadeIn 0.3s var(--ease-default) forwards;
  transform: none;
  z-index: 2;
}

.calendar-week-number.header {
  font-size: 9px;
  font-weight: 500;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  background: transparent !important; /* Remove artifact above week numbers */
  border: none !important;
  padding: 4px 2px;
  z-index: 2;
}

.calendar-cell.has-shifts {
  background: var(--gradient-secondary);
  cursor: pointer;
  justify-content: flex-start;
  gap: 4px;
}

.calendar-cell.has-shifts:hover {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.calendar-cell.empty-date {
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s var(--ease-default);
  position: relative;
}

.calendar-cell.empty-date:hover {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.calendar-cell.empty-date:hover::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: var(--accent);
  font-weight: 600;
  opacity: 0.7;
  z-index: 1;
}

.calendar-cell.empty-date:hover .calendar-day-number {
  opacity: 0.6;
}

.calendar-day-number {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  font-size: clamp(14px, 4.5vw, 18px);
  margin-bottom: 4px;
  flex-shrink: 0; /* Prevent date from shrinking */
}

/* Enhanced date numbers in shift calendar for better readability */
.shift-calendar .calendar-day-number {
  font-size: clamp(15px, 4.2vw, 20px);
  margin-bottom: 3px;
}

/* Container for shift data that will be centered in remaining space */
.calendar-shift-data {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
}

.calendar-cell.other-month .calendar-day-number {
  color: var(--text-tertiary);
}

.calendar-cell:not(.has-shifts) .calendar-day-number {
  color: var(--text-primary);
  opacity: 0.9;
}

.calendar-amount {
  font-size: clamp(10px, 2.5vw, 14px);
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Shift calendar customizations */
.shift-calendar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 20px 0;
  box-sizing: border-box;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  position: relative;
}

.shift-calendar .calendar-cell {
  min-height: 72px;
  aspect-ratio: 0.8;
}

/* Week separator styling */
.week-separator {
  position: relative;
  width: 100%;
  height: 1px;
  background: transparent;
  margin: 24px 0 20px 0;
  display: flex;
  align-items: center;
}



/* Week number positioned on left side of separator line */
.week-number-on-separator {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 2;
}



.calendar-total {
  font-size: clamp(10px, 2.8vw, 13px);
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0 3px;
  text-align: center;
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Balanced dynamic sizing for shift calendar totals */
.shift-calendar .calendar-total {
  font-size: clamp(11px, 3.2vw, 15px);
  padding: 0 2px;
  min-width: 0;
  flex-shrink: 1;
}

/* Next Shift Card Styling */
.next-shift-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: relative;
  overflow: visible;
  transition: none;
  border: none;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Next Payroll Card Styling - reuse Next Shift Card styles */
.next-payroll-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: relative;
  overflow: visible;
  transition: none;
  border: none;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.next-shift-card:hover {
  transform: none;
  box-shadow: none;
}

.next-payroll-card:hover {
  transform: none;
  box-shadow: none;
}

/* Hover effect for clickable payroll item */
.next-payroll-card .payroll-item:hover {
  background: rgba(18, 18, 18, 0.85); /* Slightly more opaque on hover */
  transform: translateY(-1px); /* Subtle lift effect */
  transition: all 0.2s ease;
}

.next-shift-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.next-payroll-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

/* Style the shift-item when it's inside the next-shift-card */
.next-shift-card .shift-item {
  background: rgba(18, 18, 18, 0.75); /* Same as next payroll card - semi-transparent background */
  backdrop-filter: blur(20px) saturate(180%); /* Same as next payroll card - enhanced blur with saturation */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px; /* Fully rounded edges */
  padding: 18px;
  margin: 0;
  border: none;
  /* Subtle 3D Bevel Effect - consistent with payroll card */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15), /* Same depth shadow as payroll card */
    inset 0 1px 0 rgba(255, 255, 255, 0.1), /* Subtle top inner highlight */
    inset 0 -1px 0 rgba(0, 0, 0, 0.2), /* Subtle bottom inner shadow */
    inset 1px 0 0 rgba(255, 255, 255, 0.05), /* Subtle left inner highlight */
    inset -1px 0 0 rgba(0, 0, 0, 0.1); /* Subtle right inner shadow */
  transition: all var(--speed-normal) var(--ease-default);
  min-height: 80px;
  position: relative;
  overflow: hidden; /* Add overflow hidden to contain the badge */
}

/* Style the payroll-item when it's inside the next-payroll-card */
.next-payroll-card .payroll-item {
  background: rgba(18, 18, 18, 0.75); /* Same as header - semi-transparent background */
  backdrop-filter: blur(20px) saturate(180%); /* Same as header - enhanced blur with saturation */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: none; /* Remove border/outline */
  border-radius: 24px; /* Fully rounded edges */
  padding: 18px;
  margin: 0;
  /* Subtle 3D Bevel Effect - refined raised appearance matching total card */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15), /* Existing depth shadow */
    inset 0 1px 0 rgba(255, 255, 255, 0.1), /* Subtle top inner highlight */
    inset 0 -1px 0 rgba(0, 0, 0, 0.2), /* Subtle bottom inner shadow */
    inset 1px 0 0 rgba(255, 255, 255, 0.05), /* Subtle left inner highlight */
    inset -1px 0 0 rgba(0, 0, 0, 0.1); /* Subtle right inner shadow */
  transition: all var(--speed-normal) var(--ease-default);
  min-height: 80px;
  position: relative;
  overflow: hidden; /* Add overflow hidden to contain the badge */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Active next shift - when it's today or tomorrow */
.next-shift-card .shift-item.active {
  background: var(--gradient-secondary);
  /* Subtle 3D Bevel Effect for active state */
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08), /* Existing depth shadow */
    inset 0 2px 0 rgba(255, 255, 255, 0.13), /* Refined top inner highlight */
    inset 0 -2px 0 rgba(0, 0, 0, 0.23), /* Refined bottom inner shadow */
    inset 2px 0 0 rgba(255, 255, 255, 0.08), /* Refined left inner highlight */
    inset -2px 0 0 rgba(0, 0, 0, 0.13); /* Refined right inner shadow */
}

/* Active next payroll - when it's soon */
.next-payroll-card .payroll-item.active {
  background: rgba(18, 18, 18, 0.85); /* Slightly more opaque when active */
  /* Subtle 3D Bevel Effect for active state */
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15), /* Existing depth shadow */
    inset 0 2px 0 rgba(255, 255, 255, 0.13), /* Refined top inner highlight */
    inset 0 -2px 0 rgba(0, 0, 0, 0.23), /* Refined bottom inner shadow */
    inset 2px 0 0 rgba(255, 255, 255, 0.08), /* Refined left inner highlight */
    inset -2px 0 0 rgba(0, 0, 0, 0.13); /* Refined right inner shadow */
}

.next-shift-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
  flex: 1;
}

.next-payroll-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
  flex: 1;
}

.empty-message {
  color: var(--text-secondary);
  font-size: 13px;
  font-style: italic;
  margin: 0;
}

/* Responsive adjustments for next shift card */
@media (max-width: 480px) {
  .next-shift-card {
    padding: 0;
    border-radius: 0;
    min-height: auto;
  }





  .next-shift-content {
    gap: 5px;
  }

  .next-shift-card .shift-item {
    padding: 16px;
    border-radius: 24px; /* Fully rounded edges */
    min-height: 80px;
  }

  .next-payroll-card {
    padding: 0;
    border-radius: 0;
    min-height: auto;
  }

  .next-payroll-content {
    gap: 5px;
  }

  .next-payroll-card .payroll-item {
    padding: 16px;
    border-radius: 24px; /* Fully rounded edges */
    min-height: 80px;
  }

  .empty-message {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .next-shift-card {
    padding: 0;
    border-radius: 0;
    min-height: auto;
  }





  .next-shift-content {
    gap: 4px;
  }

  .next-shift-card .shift-item {
    padding: 14px;
    border-radius: 24px; /* Fully rounded edges */
    min-height: 80px;
  }

  .next-payroll-card {
    padding: 0;
    border-radius: 0;
    min-height: auto;
  }

  .next-payroll-content {
    gap: 4px;
  }

  .next-payroll-card .payroll-item {
    padding: 14px;
    border-radius: 24px; /* Fully rounded edges */
    min-height: 80px;
  }

  .empty-message {
    font-size: 11px;
  }
}

/* Responsive calendar adjustments */
@media (max-width: 480px) {
  .calendar-cell {
    min-height: 40px;
    padding: 6px 4px 6px 4px;
  }

  .shift-calendar .calendar-cell {
    min-height: 45px;
  }

  .week-number-on-separator {
    font-size: 12px;
    padding: 3px 10px;
  }

  .week-separator {
    margin: 20px 0 16px 0;
  }

  .shift-calendar .calendar-header,
  .shift-calendar .calendar-grid {
    padding: 0 10px;
  }

  .week-separator::before {
    left: 70px;
    right: 10px;
    background: linear-gradient(
      to right,
      var(--border) 0%,
      var(--border) 100%
    );
  }

  .week-number-on-separator {
    left: 15px;
  }


  .calendar-amount {
    font-size: clamp(9px, 2.2vw, 12px);
  }

  .shift-calendar .calendar-total {
    font-size: clamp(10px, 3.0vw, 14px);
    padding: 0 1px;
  }

  .shift-calendar .calendar-hours-total {
    font-size: clamp(9px, 2.6vw, 12px);
  }

  .calendar-day-header {
    font-size: 11px;
    padding: 4px 2px;
  }

  .week-number, .calendar-week-number {
    font-size: 10px;
    min-height: 40px;
  }

  .week-number.header, .calendar-week-number.header {
    font-size: 8px;
    padding: 4px 2px;
  }

  .date-grid {
    grid-template-columns: 28px repeat(7, 1fr);
  }

  .calendar-header, .breakdown-calendar .calendar-grid {
    grid-template-columns: 28px repeat(7, 1fr);
  }

  .shift-calendar .calendar-header,
  .shift-calendar .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (max-width: 360px) {
  .calendar-cell {
    min-height: 35px;
    padding: 5px 4px 5px 4px;
  }

  .shift-calendar .calendar-cell {
    min-height: 40px;
  }

  .week-number-on-separator {
    font-size: 11px;
    padding: 3px 9px;
  }

  .week-separator {
    margin: 18px 0 14px 0;
  }

  .shift-calendar .calendar-header,
  .shift-calendar .calendar-grid {
    padding: 0 10px;
  }

  .week-separator::before {
    left: 65px;
    right: 10px;
    background: linear-gradient(
      to right,
      var(--border) 0%,
      var(--border) 100%
    );
  }

  .week-number-on-separator {
    left: 12px;
  }


  .calendar-amount {
    font-size: clamp(8px, 2vw, 10px);
  }

  .shift-calendar .calendar-total {
    font-size: clamp(9px, 2.8vw, 13px);
    padding: 0 1px;
  }

  .shift-calendar .calendar-hours-total {
    font-size: clamp(8px, 2.4vw, 11px);
  }

  .week-number, .calendar-week-number {
    font-size: 9px;
    min-height: 35px;
  }

  .week-number.header, .calendar-week-number.header {
    font-size: 7px;
    padding: 4px 2px;
  }

  .date-grid {
    grid-template-columns: 24px repeat(7, 1fr);
  }

  .calendar-header, .breakdown-calendar .calendar-grid {
    grid-template-columns: 24px repeat(7, 1fr);
  }

  .shift-calendar .calendar-header,
  .shift-calendar .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (max-width: 320px) {
  .week-number, .calendar-week-number {
    font-size: 8px;
  }

  .shift-calendar .calendar-cell {
    min-height: 36px;
  }

  .week-number-on-separator {
    font-size: 10px;
    padding: 2px 8px;
  }

  .week-separator {
    margin: 16px 0 12px 0;
  }

  .shift-calendar .calendar-header,
  .shift-calendar .calendar-grid {
    padding: 0 10px;
  }

  .week-separator::before {
    left: 60px;
    right: 10px;
    background: linear-gradient(
      to right,
      var(--border) 0%,
      var(--border) 100%
    );
  }

  .week-number-on-separator {
    left: 10px;
  }

  .week-number.header, .calendar-week-number.header {
    font-size: 6px;
    padding: 4px 2px;
  }

  .shift-calendar .calendar-total {
    font-size: clamp(8px, 2.6vw, 12px);
    padding: 0 1px;
  }

  .shift-calendar .calendar-hours-total {
    font-size: clamp(7px, 2.2vw, 10px);
  }

  .date-grid {
    grid-template-columns: 20px repeat(7, 1fr);
  }

  .calendar-header, .breakdown-calendar .calendar-grid {
    grid-template-columns: 20px repeat(7, 1fr);
  }

  .shift-calendar .calendar-header,
  .shift-calendar .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* Specific clipping area for email animation to prevent horizontal overflow */
.header-info::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 0;
  background: var(--bg-primary);
  pointer-events: none;
  z-index: 1;
  transition: width 0.4s ease;
}

.header-info.email-animating::after {
  width: 50px; /* Mask area to hide sliding elements */
}

/* Removed expanded card scrollbar styles - now using modal approach */





/* Close button */
/* Removed expanded card close button styles - now using modal approach */

@keyframes scaleIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUpFadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* New modal element animations */
@keyframes slideInFromTop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleInDelayed {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Shift detail animations */
@keyframes shiftDetailEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shiftDetailExit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Shift Detail Modal Styles */
.shift-detail-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border);
  border-radius: 20px;
  animation: shiftDetailEnter 0.4s var(--ease-default) forwards;
}

.shift-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.shift-detail-icon {
  color: var(--accent);
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shift-detail-title {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.shift-detail-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-section:last-child {
  border-bottom: none;
}

/* Remove bottom border from section before total */
.detail-section:has(+ .detail-section.total),
.detail-section + .detail-section.total {
  border-bottom: none;
}

/* Alternative approach for better browser support */
.detail-section.bonus-section {
  border-bottom: none;
}

.detail-section.total {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
  border-bottom: none;
}

/* Delete button section styling */
.detail-section.delete-section {
  padding-top: 6px;
  border-bottom: none;
  justify-content: center;
}

/* Delete button specific styling */
.detail-section.delete-section .btn {
  max-width: 200px;
  width: auto;
  padding: 10px 20px;
}

.detail-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}

.detail-value.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.detail-value.large {
  font-size: 20px;
  font-weight: 700;
}

/* Close button for shift detail modal */
.shift-detail-card .close-btn {
  position: absolute;
  top: 20px;
  right: 16px;  /* 16px from right edge */
  background: rgba(255, 102, 153, 0.1);
  border: 1px solid rgba(255, 102, 153, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger);
  transition: all 0.2s var(--ease-default);
  font-size: 20px;
  font-weight: bold;
}

.shift-detail-card .close-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  color: rgba(16, 185, 129, 0.8);
}

/* Responsive adjustments for shift detail modal */
@media (max-width: 768px) {
  .shift-detail-card {
    width: min(95vw, 450px) !important;
    margin: 0;
    max-height: 85vh;
    padding: 20px !important;
  }

  .shift-detail-title {
    font-size: 20px;
  }

  .detail-section {
    padding: 10px 0;
  }

  .detail-label {
    font-size: 13px;
  }

  .detail-value {
    font-size: 15px;
  }

  .detail-value.large {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .shift-detail-card {
    width: calc(100vw - 20px) !important;
    left: 10px !important;
    right: 10px !important;
    top: 50% !important;
    left: 10px !important;
    right: 10px !important;
    margin: 0;
    padding: 16px !important;
    border-radius: 16px;
  }

  .shift-detail-header {
    gap: 12px;
    margin-bottom: 20px;
  }

  .shift-detail-title {
    font-size: 18px;
  }

  .detail-section {
    padding: 8px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .detail-section.delete-section {
    align-items: center;
    flex-direction: row;
  }

  .detail-section.delete-section .btn {
    max-width: 160px;
    font-size: 14px;
    padding: 8px 16px;
  }

  .detail-value {
    text-align: left;
    font-size: 14px;
  }

  .detail-value.large {
    font-size: 16px;
  }

  .shift-detail-card .close-btn {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}

/* Removed responsive adjustments for expanded cards - now using modal approach */

@media (max-width: 480px) {
  /* Removed .breakdown-card.expanded styles - now using modal approach */
}



/* Welcome screen overlay */
#welcomeScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.welcome-container {
  text-align: center;
  max-width: 90vw;
}

.welcome-line {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent3), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 10px;
}

.welcome-line:last-child {
  margin-bottom: 0;
}

.name-line {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.name-part {
  display: inline-flex;
  white-space: nowrap;
}

.name-space {
  flex-shrink: 0;
}

#welcomeScreen h1 {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent3), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  hyphens: auto;
  max-width: 90vw;
  line-height: 1.2;
  transform-origin: center center;
}

.letter {
  display: inline-block;
  opacity: 0;
  transform-origin: center center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent3), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Ensure name parts stay together on the same line */
.name-part {
  white-space: nowrap;
}

@keyframes letter-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes letter-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes text-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Mobile optimizations for header */
@media (max-width: 768px) {
  .header-info {
    gap: 8px; /* Reduce gap on mobile */
    min-height: 20px; /* Fixed minimum height to prevent expansion */
    justify-content: center; /* Center content on mobile for better alignment */
  }

  /* Prevent header height changes */
  .header {
    min-height: auto;
    max-height: none;
  }

  .header-info {
    align-items: center;
    height: 20px; /* Fixed height */
    overflow: visible; /* Keep visible for mobile */
    flex-wrap: nowrap;
  }
}

@media (max-width: 480px) {
  .header-info {
    gap: 6px; /* Further reduce gap */
    height: 18px; /* Slightly smaller fixed height */
  }
}

/* Form Actions for Edit Modal */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px; /* Extra large spacing - final section */
  padding-top: 20px; /* Major spacing with subtle separator */
  border-top: 1px solid var(--border);
}

.form-actions .btn {
  min-width: 120px;
  flex: 0 0 auto;
}

/* Modal Body Styling */
.modal-body {
  padding: 20px;
}

/* Profile Picture Upload Component */
.profile-picture-upload-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 8px;
}

.profile-picture-preview {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-picture-current {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.profile-picture-current img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-placeholder-icon {
  width: 40px;
  height: 40px;
  stroke: var(--text-secondary);
  opacity: 0.6;
}

.profile-picture-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.profile-picture-status {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.profile-picture-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-picture-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-picture-controls .btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  min-height: auto;
}

.profile-picture-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-picture-progress .progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.profile-picture-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.profile-picture-progress .progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Profile picture hover effects */
.profile-picture-current:hover {
  border-color: var(--accent);
  transform: scale(1.02);
  transition: all var(--speed-normal) var(--ease-default);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Ensure profile picture images in modal have proper styling */
.profile-picture-current img {
  transition: all var(--speed-normal) var(--ease-default);
}

.profile-picture-current:hover img {
  transform: scale(1.02);
}

/* Loading state for profile picture */
.profile-picture-current.loading {
  opacity: 0.6;
  pointer-events: none;
}

.profile-picture-current.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--accent);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile responsiveness for profile picture upload */
@media (max-width: 480px) {
  .profile-picture-upload-container {
    padding: 12px;
    gap: 12px;
  }

  .profile-picture-preview {
    gap: 12px;
  }

  .profile-picture-current {
    width: 60px;
    height: 60px;
  }

  .profile-placeholder-icon {
    width: 30px;
    height: 30px;
  }

  .profile-picture-controls {
    gap: 8px;
  }

  .profile-picture-controls .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* Image Cropping Modal Styles */
#cropModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1300;
  max-width: 800px;
  width: 95vw;
  height: auto;
  /* Calculate available height accounting for header (80px) and floating action bar (80px) with padding */
  max-height: calc(100vh - 160px);
  min-height: 500px;
  overflow: hidden;
  border-radius: 24px;
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.crop-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.crop-container {
  flex: 1;
  min-height: 300px;
  max-height: 400px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.crop-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.crop-preview-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.crop-preview-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.crop-preview-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg-primary);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: all var(--speed-normal) var(--ease-default);
}

.crop-preview-container:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.crop-preview {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
}

.crop-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.crop-zoom-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crop-control-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 60px;
  letter-spacing: -0.01em;
}

.zoom-slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.zoom-btn {
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--speed-normal) var(--ease-default);
}

.zoom-btn:hover {
  background: var(--bg-hover);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.zoom-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all var(--speed-normal) var(--ease-default);
}

.zoom-slider::-webkit-slider-thumb:hover {
  background: var(--primary-light);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(58, 190, 246, 0.3);
}

.zoom-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all var(--speed-normal) var(--ease-default);
}

.zoom-slider::-moz-range-thumb:hover {
  background: var(--primary-light);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(58, 190, 246, 0.3);
}

/* Mobile responsiveness for cropping modal */
@media (max-width: 768px) {
  #cropModal .modal-content {
    width: 100vw;
    height: 100vh;
    /* Ensure modal doesn't exceed viewport on mobile */
    max-height: 100vh;
    border-radius: 0;
    border: none;
    /* Position modal to account for mobile browser UI */
    top: 0;
    left: 0;
    transform: none;
  }

  .crop-modal-body {
    padding: 16px;
    gap: 16px;
    padding-bottom: 80px; /* Space for fixed footer */
  }

  .crop-container {
    min-height: 250px;
    max-height: 300px;
  }

  .crop-controls {
    padding: 12px;
    gap: 12px;
  }

  .crop-zoom-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .crop-control-label {
    min-width: auto;
    text-align: center;
  }

  .crop-preview-container {
    width: 100px;
    height: 100px;
  }

  /* Mobile-specific preview optimizations */
  .crop-preview-section {
    order: -1; /* Move preview to top on mobile */
    margin-bottom: 8px;
  }

  /* Ensure modal footer is properly positioned */
  #cropModal .modal-fixed-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    z-index: 1400;
    border-radius: 0 0 24px 24px;
  }
}

@media (max-width: 480px) {
  #cropModal.active {
    /* Adjust padding for smaller screens */
    padding: 60px 10px 80px 10px;
  }

  .crop-modal-body {
    padding: 12px;
    gap: 12px;
  }

  .crop-container {
    min-height: 200px;
    max-height: 250px;
  }

  .zoom-btn {
    padding: 6px;
  }

  .crop-preview-container {
    width: 80px;
    height: 80px;
  }
}

/* Modal Footer Buttons Styling */
.modal-footer-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Ensure buttons are properly sized and spaced */
.modal-footer-buttons .btn {
  flex: 1;
  max-width: 200px;
  min-width: 120px;
  justify-content: center;
}

/* Mobile specific modal footer button styling */
@media (max-width: 768px) {
  .modal-footer-buttons {
    gap: 10px;
    padding: 0;
  }

  .modal-footer-buttons .btn {
    flex: 1;
    min-width: 100px;
    max-width: none;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Ensure buttons stay horizontal on mobile */
  #cropModal .modal-footer-buttons {
    flex-direction: row !important;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .modal-footer-buttons {
    gap: 8px;
  }

  .modal-footer-buttons .btn {
    padding: 10px 12px;
    font-size: 13px;
    min-width: 80px;
  }

  /* Reduce button text on very small screens */
  #cropModal .modal-footer-buttons .btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Custom Cropper.js styling to match design system */
.cropper-container {
  background: var(--bg-primary) !important;
}

.cropper-view-box {
  outline: 2px solid var(--primary) !important;
  outline-color: rgba(58, 190, 246, 0.8) !important;
  box-shadow: 0 0 20px rgba(58, 190, 246, 0.3) !important;
}

.cropper-face {
  background: rgba(58, 190, 246, 0.1) !important;
}

.cropper-line {
  background: var(--primary) !important;
  opacity: 0.8 !important;
}

.cropper-point {
  background: var(--primary) !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  border: 2px solid white !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  opacity: 1 !important;
}

.cropper-point:hover {
  background: var(--primary-light) !important;
  transform: scale(1.2) !important;
  transition: all var(--speed-normal) var(--ease-default) !important;
}

.cropper-modal {
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(2px) !important;
}

.cropper-bg {
  background-image: repeating-conic-gradient(
    var(--bg-tertiary) 0% 25%,
    var(--bg-secondary) 25% 50%
  ) !important;
  background-size: 20px 20px !important;
  opacity: 0.8 !important;
}

/* Enhance cropper responsiveness */
@media (max-width: 768px) {
  .cropper-point {
    width: 12px !important;
    height: 12px !important;
  }

  .cropper-line {
    background: var(--primary) !important;
    opacity: 1 !important;
  }

  .cropper-view-box {
    outline-width: 3px !important;
  }
}

/* Loading state for crop image */
.crop-image {
  opacity: 0;
  transition: opacity var(--speed-normal) var(--ease-default);
}

.crop-image.loaded {
  opacity: 1;
}

/* Enhance modal backdrop for cropping */
#cropModal.active {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* Add subtle animation to crop preview */
.crop-preview canvas {
  transition: all var(--speed-normal) var(--ease-default);
  border-radius: inherit;
}

.crop-preview:hover canvas {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(58, 190, 246, 0.2);
}

/* Improve zoom slider track styling */
.zoom-slider::-webkit-slider-track {
  background: linear-gradient(to right,
    var(--bg-tertiary) 0%,
    var(--primary) 50%,
    var(--bg-tertiary) 100%
  );
  height: 6px;
  border-radius: 3px;
}

.zoom-slider::-moz-range-track {
  background: linear-gradient(to right,
    var(--bg-tertiary) 0%,
    var(--primary) 50%,
    var(--bg-tertiary) 100%
  );
  height: 6px;
  border-radius: 3px;
  border: none;
}

/* Add focus states for accessibility */
.zoom-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.zoom-slider:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.modal .form-group label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.modal .form-row {
  margin-bottom: 16px;
}

/* Add Shift Modal Specific Styles */
#addShiftModal .modal-content {
  max-width: 600px !important;
  position: relative;
  overflow: visible !important; /* Allow internal body to handle scrolling */
  height: auto !important; /* Override general modal height */
  max-height: calc(100vh - 40px) !important; /* Keep within viewport with margin */
  margin-top: 0; /* Remove fixed margin */
  margin-bottom: 0;
  display: flex !important;
  flex-direction: column !important;
}

#addShiftModal .date-grid {
  margin-bottom: 8px;
}

/* Standard modal body padding for add shift modal */
#addShiftModal .modal-body {
  padding-top: 20px;
  padding-bottom: 80px; /* Space to avoid footer overlap */
  overflow-y: auto !important; /* Force scrolling on modal body only when needed */
  flex: 1 !important; /* Allow body to grow */
}

/* Add shift modal close button in form actions */
.form-actions .modal-close-bottom,
.modal-bottom-actions .modal-close-bottom,
.shift-actions .modal-close-bottom,
.modal-fixed-footer .modal-close-bottom {
  background: rgba(255, 102, 153, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 102, 153, 0.4);
  color: var(--danger);
  transition: all 0.2s var(--ease-default);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  padding: 0;
  gap: 0;
}

.form-actions .modal-close-bottom:hover,
.modal-bottom-actions .modal-close-bottom:hover,
.modal-fixed-footer .modal-close-bottom:hover {
  background: rgba(255, 102, 153, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 102, 153, 0.4);
  color: rgba(255, 255, 255, 0.9);
}

/* Hide text inside circular close buttons, keep only the X icon */
.modal-fixed-footer .modal-close-bottom {
  font-size: 0; /* Hide text */
}

.modal-fixed-footer .modal-close-bottom svg {
  font-size: 16px; /* Ensure icon is visible */
  width: 16px;
  height: 16px;
}

/* Ensure buttons in modal footer have proper spacing and alignment */
.modal-fixed-footer .btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Make the add shift button narrower */
#addShiftModal .modal-fixed-footer .btn-primary {
  max-width: 160px;
  white-space: nowrap;
}

/* Fixed footer for modals */
.modal-fixed-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: var(--bg-card);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 0 0 24px 24px;
}

/* Crop modal specific footer positioning */
#cropModal .modal-fixed-footer {
  background: var(--bg-secondary);
  z-index: 1400; /* Ensure it's above modal content */
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Modal button group for centered buttons */
.modal-button-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

/* Modal footer with buttons on both sides */
.modal-fixed-footer[style*="space-between"] {
  justify-content: space-between;
}

/* Bottom actions section for settings modal - legacy (can be removed if not used elsewhere) */
.modal-bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  margin-top: auto;
  flex-shrink: 0;
}

.bottom-buttons-center {
  display: flex;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

/* Mobile responsiveness for modal bottom actions */
@media (max-width: 480px) {
  .modal-bottom-actions,
  .modal-fixed-footer {
    padding: 12px 16px;
  }

  .modal-bottom-actions .modal-close-bottom,
  .modal-fixed-footer .modal-close-bottom {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Standard mobile padding for add shift modal */
@media (max-width: 480px) {
  #addShiftModal .modal-body {
    padding-top: 20px;
  }
}

.selected-dates-info {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--accent3-alpha);
  border-radius: 16px;
  border: 1px solid var(--accent3);
}

.selected-dates-info span {
  font-weight: 600;
  color: var(--accent3);
}

/* Edit Shift Modal Specific Styles */
/* Apply the same styling overrides as Add Shift Modal for consistency */
#editShiftModal .modal-content {
  height: auto !important;
  width: min(90vw, 600px) !important;
  max-width: 600px !important;
  margin: 20px auto !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  /* Remove height constraints completely - let modal grow with content */
  max-height: none !important;
}

#editShiftModal .modal-body {
  flex: 1 !important;
  overflow-y: auto !important;
  padding-bottom: 80px !important; /* Provide space for fixed footer */
  /* Allow natural content sizing unless overflow occurs */
  max-height: none !important;
}

/* Ensure fixed footer doesn't interfere with content sizing */
#editShiftModal .modal-fixed-footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

#editShiftModal .date-grid {
  margin-bottom: 20px;
}

/* EDIT SHIFT MODAL OVERRIDES - Must come after general modal rules */
/* Force edit shift modal to be centered and fit content naturally */
@media (min-width: 769px) {
  #editShiftModal .modal-content {
    height: auto !important;
    width: min(90vw, 600px) !important;
    max-width: 600px !important;
    margin: 20px auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    /* Remove height constraints completely - let modal grow with content */
    max-height: none !important;
  }
}

@media (max-width: 768px) {
  #editShiftModal .modal-content {
    height: auto !important;
    width: 100vw !important;
    margin: 10px 0 !important;
    /* Remove height constraints to allow modal to grow with content */
    max-height: none !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

/* Ensure edit shift modal displays centered like add shift modal */
#editShiftModal.active {
  align-items: center !important;
  justify-content: center !important;
  padding-top: 0 !important;
  display: flex !important;
}

/* Mobile override for edit shift modal positioning */
@media (max-width: 768px) {
  #editShiftModal.active {
    padding-top: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    display: flex !important;
  }
}

/* Desktop - center edit shift modal within content viewport */
@media (min-width: 769px) {
  #editShiftModal.active {
    justify-content: center !important;
    align-items: center !important;
    padding-top: 0 !important;
    display: flex !important;
  }
}

/* Full screen modals on mobile, constrained on desktop */
@media (max-width: 768px) {
  #addShiftModal .modal-content,
  #editShiftModal .modal-content {
    width: 100vw;
    max-width: none;
    border-radius: 24px;
    margin: 0;
    position: relative; /* Ensure relative positioning for absolute close button */
  }

  #addShiftModal .modal-content {
    height: auto !important; /* Force auto height, override general modal styles */
    margin: 10px 0 !important;
    overflow: visible !important; /* Allow modal to grow beyond viewport if needed */
    display: flex !important;
    flex-direction: column !important;
    /* Remove height constraints to allow modal to grow with content */
    max-height: none !important;
  }

  #addShiftModal .modal-body {
    padding: 20px;
    overflow-y: auto !important;
    flex: 1 !important; /* Allow natural growth */
    padding-bottom: 80px !important; /* Prevent footer overlap */
  }

  #editShiftModal .modal-content {
    height: auto !important; /* Force auto height, override general modal styles */
    margin: 10px 0 !important;
    overflow: visible !important; /* Allow modal to grow beyond viewport if needed */
    display: flex !important;
    flex-direction: column !important;
    /* Remove height constraints to allow modal to grow with content */
    max-height: none !important;
  }

  #editShiftModal .modal-body {
    padding: 20px;
    overflow-y: auto !important;
    flex: 1 !important; /* Allow natural growth */
    padding-bottom: 80px !important; /* Prevent footer overlap */
  }
}

@media (min-width: 769px) {
  #addShiftModal .modal-content,
  #editShiftModal .modal-content {
    max-width: 600px;
    width: 90vw;
    height: auto;
    margin-top: 8vh; /* Reduced to work with base margin-top: 20px */
  }

  #addShiftModal .modal-content {
    display: flex !important;
    flex-direction: column !important;
    /* Remove height constraints to allow modal to grow with content */
    max-height: none !important;
  }

  #addShiftModal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 80px !important;
  }

  #editShiftModal .modal-content {
    display: flex !important;
    flex-direction: column !important;
    /* Remove height constraints to allow modal to grow with content */
    max-height: none !important;
  }

  #editShiftModal .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 80px !important;
  }
}

/* Make modal buttons more accessible on mobile */
@media (max-width: 480px) {
  .form-actions {
    flex-direction: row;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 16px 20px;
    margin: 20px -20px -20px -20px;
    border-top: 1px solid var(--border);
    justify-content: space-between;
    align-items: center;
  }

  .form-actions .btn {
    flex: 1;
    min-width: auto;
  }
}

/* Shift actions styling for centered edit/delete buttons */
.actions-section .shift-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.actions-section .shift-actions .btn {
    width: 100%;
    max-width: 200px;
    justify-content: center;
}

/* Responsive adjustments for mobile */
@media (max-width: 480px) {
    .actions-section .shift-actions .btn {
        max-width: none;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Responsive welcome screen for smaller screens and long names */
@media (max-width: 768px) {
  .welcome-line {
    font-size: 44px;
  }

  #welcomeScreen h1 {
    font-size: 36px;
    max-width: 95vw;
    padding: 0 10px;
  }
}

@media (max-width: 480px) {
  .welcome-line {
    font-size: 42px;
    line-height: 1.1;
  }

  .welcome-container {
    max-width: 98vw;
    padding: 0 4px;
  }

  /* Keep name parts together but allow breaking between words */
  .name-line {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
  }

  .name-part {
    white-space: nowrap;
    display: inline-flex;
  }

  /* Ensure space between name parts is visible */
  .name-space {
    display: inline-block;
    width: 0.3em;
  }

  #welcomeScreen h1 {
    font-size: 28px;
    max-width: 98vw;
    padding: 0 4px;
    line-height: 1.3;
  }
}

/* Utility classes for consistent spacing */
.mb-12 {
  margin-bottom: 12px;
}

.mb-18 {
  margin-bottom: 18px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-4 {
  margin-top: 4px;
}

.pb-80 {
  padding-bottom: 80px;
}

/* Position helper for auth pages */
.absolute-top-left {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* Auth specific footers */
.footer-auth {
  width: 100%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  text-align: center;
  padding: 18px 10px;
  font-size: 14px;
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  max-width: 600px;
  margin: 0 auto;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: auto;
  flex-shrink: 0;
}

/* Container for sections - hidden scrollbar but scrolling works */
.snap-container {
  height: var(--app-height, 100vh);
  overflow-y: auto;
  position: relative;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.snap-container::-webkit-scrollbar {
  display: none;
}

/* Individual sections */
.snap-section {
  height: var(--app-height, 100vh);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Shift section can expand beyond viewport */
.snap-section.shift-section {
  min-height: var(--app-height, 100vh);
  height: auto;
  background: transparent;
  padding-bottom: 100px; /* Add space for floating bar */
}



/* Dashboard section styling */
.dashboard-section {
  background: transparent;
}

.dashboard-section .app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%; /* Ensure it doesn't grow beyond container */
  min-height: 0; /* Allow flex children to shrink */
}

.dashboard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 20px;
  padding-bottom: 20px;
  gap: 20px;
  position: relative;
  /* Ensure the content can fill the full height */
  min-height: 0;
  height: 100%;
}

/* Override gap specifically for desktop to reduce spacing before month picker */
@media (min-width: 1024px) {
  .dashboard-content {
    gap: 16px; /* Reduced gap on desktop for tighter layout */
  }

  .statistics-content {
    gap: 16px; /* Consistent with dashboard content */
  }
}

/* Statistics section styling */
.statistics-section {
  background: transparent;
  min-height: auto; /* Allow content to determine height */
  height: auto;
  padding-top: 20px;
  padding-bottom: 20px;
}

.statistics-section .app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.statistics-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: 20px;
  gap: 20px;
  position: relative;
  min-height: 0;
  height: 100%;
}

/* Shift section styling */
.shift-section {
  background: transparent;
  padding-top: 20px;
  min-height: var(--app-height, 100vh);
  padding-bottom: 100px; /* Add space for floating bar */
}

/* Visual separator between sections - removed, using header lines instead */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Modern horizontal header styling for shifts section */
.shift-history-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 24px;
  margin-top: -16px;
  margin-bottom: 20px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: visible;
  border: none;
}

.shift-history-header::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: var(--border);
  margin-left: -50vw;
}

.shift-history-header::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 45%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--border) 5%, var(--text-secondary) 50%, var(--border) 90%, transparent);
  border-radius: 2px;
  opacity: 0.8;
}

.shift-history-header > * {
  position: relative;
  z-index: 1;
}

.shift-history-header .header-left {
  display: none;
}

.shift-history-header .header-right {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 12px;
}

/* Large calendar icon on the left */
.calendar-icon-large {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  transition: all var(--speed-normal) var(--ease-default);
  margin-left: 0;
}

.calendar-icon-large:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.4);
}

.calendar-icon-large svg {
  width: 28px;
  height: 28px;
  color: white;
}

/* Header text content */
.header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
}

.header-text h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.header-text .header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  opacity: 0.8;
}



/* Responsive adjustments for shift history header */
@media (max-width: 768px) {
  .shift-history-header {
    padding: 20px 20px 16px;
    margin-top: 0;
    margin-bottom: 16px;
    gap: 14px;
  }

  .shift-history-header .header-right {
    padding-top: 8px;
  }

  .calendar-icon-large {
    width: 52px;
    height: 52px;
  }

  .calendar-icon-large svg {
    width: 24px;
    height: 24px;
  }

  .header-text h2 {
    font-size: 20px;
  }

  .header-text .header-subtitle {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .shift-history-header {
    padding: 16px 16px 12px;
    margin-top: 0;
    margin-bottom: 12px;
    gap: 12px;
  }

  .shift-history-header .header-left {
    display: none;
  }

  .shift-history-header .header-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 6px;
  }

  .header-text {
    align-items: center;
  }

  .calendar-icon-large {
    width: 48px;
    height: 48px;
  }

  .calendar-icon-large svg {
    width: 22px;
    height: 22px;
  }

  .header-text h2 {
    font-size: 18px;
  }

  .header-text .header-subtitle {
    font-size: 11px;
  }
}

/* Floating action bar for shift controls */
.floating-action-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 29, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Distribute space evenly */
  gap: 12px;
  z-index: 1000;
  width: 70%; /* Fixed percentage of viewport */
  max-width: 600px; /* Cap maximum width for large screens */
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: opacity 0.3s ease-out;
  box-sizing: border-box;
}

/* Backdrop blur box behind floating action bar */
.floating-action-bar-backdrop {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: 160px; /* Action bar height (~60px) + bottom spacing (20px) + extra height (80px) */
  background: linear-gradient(to top,
    rgba(18, 18, 18, 0.3) 0%,
    rgba(18, 18, 18, 0.2) 40%,
    rgba(18, 18, 18, 0.1) 70%,
    transparent 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  mask: linear-gradient(to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 30%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask: linear-gradient(to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 30%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 999; /* Below action bar (1000) but above content, below modals (1200) */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Backdrop is hidden by default and controlled by JavaScript */
.shift-section .floating-action-bar-backdrop {
  opacity: 0;
}

/* Hide backdrop in compact/calendar view */
body.compact-view .shift-section .floating-action-bar-backdrop {
  opacity: 0;
}

/* Ensure all child elements can size properly */
.floating-action-bar * {
  max-width: none; /* Override any inherited max-width */
}

/* View toggle in floating bar */
.floating-action-bar .view-toggle {
  margin-bottom: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex: 1 1 auto; /* Allow toggle to grow/shrink */
}

.floating-action-bar .view-toggle .tab-btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 24px;
  white-space: nowrap;
  flex: 1 1 auto; /* Allow buttons to grow/shrink equally */
  min-width: 0; /* Allow shrinking below content width */
  text-align: center;
}

/* Ensure active state maintains rounded corners */
.floating-action-bar .view-toggle .tab-btn.active {
  border-radius: 24px;
}

/* Add button in floating bar */
.floating-action-bar .add-btn {
  background: var(--accent);
  border: none;
  border-radius: 16px;
  padding: 8px 16px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: var(--font-weight-semibold); /* 600 - Strong emphasis for primary actions */
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--speed-normal) var(--ease-default);
  flex: 0 0 auto; /* Don't grow/shrink */
  white-space: nowrap;
  letter-spacing: 0.025em; /* Positive tracking for action buttons */
  text-transform: uppercase; /* Modern action button styling */
}

.floating-action-bar .add-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.floating-action-bar .add-btn svg {
  width: 18px;
  height: 18px;
}

/* Month Navigation in Floating Action Bar */
.month-navigation-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 0 0 auto; /* Don't grow/shrink */
}

.month-nav-btn-nav {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--speed-normal) var(--ease-default);
  flex-shrink: 0;
}

.month-nav-btn-nav:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.3);
  color: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.month-nav-btn-nav:active {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(0);
}

.month-nav-btn-nav .icon-sm {
  width: 14px;
  height: 14px;
}

.month-nav-display-nav {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Responsive adjustments - much simpler! */
@media (max-width: 480px) {
  .floating-action-bar {
    width: 85%; /* Slightly wider on mobile */
    bottom: 10px;
    padding: 10px 12px;
    gap: 8px;
  }

  /* Further optimize month navigation for smaller mobile screens */
  .month-nav-btn {
    width: 40px; /* Smaller but still touch-friendly */
    height: 40px;
    font-size: var(--text-sm); /* Smaller font size for very small screens */
  }

  .month-nav-btn .icon-sm {
    width: 16px; /* Standard icon size for small screens */
    height: 16px;
  }

  .month-display {
    font-size: var(--text-base); /* Reduced by one size from text-lg */
    min-width: 90px; /* Reduce width for small screens */
    font-weight: var(--font-weight-medium); /* Reduce weight slightly for better balance */
  }

  .floating-action-bar .view-toggle {
    gap: 3px;
  }

  .floating-action-bar .view-toggle .tab-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .floating-action-bar .add-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .floating-action-bar .add-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Month navigation responsive adjustments */
  .month-navigation-nav {
    gap: 8px;
  }

  .month-nav-btn-nav {
    width: 28px;
    height: 28px;
  }

  .month-nav-btn-nav .icon-sm {
    width: 12px;
    height: 12px;
  }

  .month-nav-display-nav {
    font-size: var(--text-xs);
    min-width: 70px;
  }

  /* Adjust backdrop height for mobile */
  .floating-action-bar-backdrop {
    height: 130px; /* Smaller action bar height + 10px bottom + extra height for coverage */
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .floating-action-bar {
    width: 90%; /* Even wider on very small screens */
    bottom: 10px;
    gap: 6px;
    padding: 8px 10px;
  }

  .floating-action-bar .view-toggle .tab-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .floating-action-bar .add-btn {
    padding: 5px 10px;
    font-size: 12px;
    gap: 6px;
  }

  .floating-action-bar .add-btn svg {
    width: 14px;
    height: 14px;
  }

  /* Month navigation for extra small screens */
  .month-navigation-nav {
    gap: 6px;
  }

  .month-nav-btn-nav {
    width: 26px;
    height: 26px;
  }

  .month-nav-btn-nav .icon-sm {
    width: 11px;
    height: 11px;
  }

  .month-nav-display-nav {
    font-size: var(--text-xs);
    min-width: 60px;
  }
}

/* Very small screens - hide button text if needed */
@media (max-width: 320px) {
  .floating-action-bar .add-btn span {
    display: none; /* Hide text on very small screens */
  }

  .floating-action-bar .add-btn {
    padding: 6px 10px; /* Square-ish button when icon only */
  }

  /* Month navigation for very small screens */
  .month-navigation-nav {
    gap: 4px;
  }

  .month-nav-btn-nav {
    width: 24px;
    height: 24px;
  }

  .month-nav-btn-nav .icon-sm {
    width: 10px;
    height: 10px;
  }

  .month-nav-display-nav {
    font-size: 11px;
    min-width: 50px;
  }
}

/* Removed responsive mobile simplification - shift cards now show full information on all screen sizes */

/* Add proper spacing between weekday and countdown on wider screens */
.next-shift-card .shift-date-weekday {
  margin-right: 4px; /* Add space before countdown on wider screens */
}

/* Default format for wider screens: show parentheses, hide dot separator */
.next-shift-card .countdown-wrapper {
  display: inline; /* Show parentheses version */
}

.next-shift-card .countdown-dot-separator {
  display: none; /* Hide dot separator */
}

.next-shift-card .countdown-no-parens {
  display: none; /* Hide non-parentheses version */
}

/* Prevent countdown timer from wrapping to new line */
.next-shift-card .shift-countdown-timer {
  white-space: nowrap; /* Prevent line breaks */
  display: inline-block; /* Keep it inline but prevent wrapping */
  flex-shrink: 1; /* Allow countdown to shrink if needed */
  min-width: 0; /* Allow shrinking below content size */
}

/* Mobile responsive layout fixes for shift cards */
@media (max-width: 480px) {
  /* Reduce overall card padding to give more space */
  .next-shift-card .shift-item {
    padding: 14px 16px; /* Keep reasonable padding */
  }

  /* Constrain shift-info to prevent overflow */
  .next-shift-card .shift-info {
    min-width: 0; /* Allow shrinking */
    overflow: hidden; /* Prevent overflow */
  }

  /* Reduce space between shift-info and amount wrapper */
  .next-shift-card .shift-amount-wrapper {
    margin-left: 10px; /* Slightly reduced from 16px */
    flex-shrink: 0; /* Keep amount section fixed */
  }

  /* Ensure shift date elements stay on one line - KEEP ORIGINAL FONT SIZE */
  .next-shift-card .shift-date {
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
  }

  .next-shift-card .shift-date-number {
    flex-shrink: 0; /* Keep date number fixed */
  }

  .next-shift-card .shift-date-weekday {
    margin-right: 3px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .next-shift-card .shift-date-separator {
    margin: 0 4px;
    flex-shrink: 0;
  }

  .next-shift-card .shift-countdown-timer {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Ensure time range stays on one line - KEEP ORIGINAL FONT SIZE */
  .next-shift-card .shift-time-with-hours {
    flex-wrap: nowrap;
    gap: 3px; /* Slightly reduced gap */
    white-space: nowrap;
  }

  .next-shift-card .shift-time-arrow {
    margin: 0 4px; /* Slightly reduced margins */
    flex-shrink: 0;
  }

  /* Mobile responsive layout fixes for payroll cards */
  .next-payroll-card .payroll-item {
    padding: 14px 16px; /* Keep reasonable padding */
  }

  .next-payroll-card .shift-info {
    min-width: 0; /* Allow shrinking */
    overflow: hidden; /* Prevent overflow */
  }

  .next-payroll-card .shift-amount-wrapper {
    margin-left: 10px; /* Slightly reduced from 16px */
    flex-shrink: 0; /* Keep amount section fixed */
  }

  .next-payroll-card .shift-date {
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
  }

  .next-payroll-card .shift-date-number {
    flex-shrink: 0; /* Keep date number fixed */
  }

  .next-payroll-card .shift-date-weekday {
    margin-right: 3px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .next-payroll-card .shift-time-with-hours {
    flex-wrap: nowrap;
    gap: 3px; /* Slightly reduced gap */
    white-space: nowrap;
  }
}

/* Extra small mobile devices - only reduce font sizes here */
@media (max-width: 360px) {
  /* More aggressive space optimization */
  .next-shift-card .shift-item {
    padding: 12px 14px;
  }

  .next-shift-card .shift-amount-wrapper {
    margin-left: 8px;
  }

  /* Font sizes no longer need reduction due to shorter date text */
  /* .next-shift-card .shift-date font-size removed - using default size */

  .next-shift-card .shift-date-weekday {
    margin-right: 2px;
    font-size: var(--text-lg) !important; /* Maintain 18px font size on mobile */
  }

  .next-shift-card .shift-date-separator {
    margin: 0 3px;
  }

  .next-shift-card .shift-countdown-timer {
    font-size: 0.9em;
  }

  /* Slightly smaller time display */
  .next-shift-card .shift-time-with-hours {
    gap: 2px;
    font-size: 13px; /* Slightly smaller */
  }

  .next-shift-card .shift-time-arrow {
    margin: 0 3px;
  }

  /* More aggressive space optimization for payroll cards */
  .next-payroll-card .payroll-item {
    padding: 12px 14px;
  }

  .next-payroll-card .shift-amount-wrapper {
    margin-left: 8px;
  }

  /* Reduce font sizes for small screens */
  .next-payroll-card .shift-date {
    font-size: 13px; /* Slightly smaller */
  }

  .next-payroll-card .shift-date-weekday {
    margin-right: 2px;
  }

  .next-payroll-card .shift-time-with-hours {
    gap: 2px;
    font-size: 13px; /* Slightly smaller */
  }
}

/* Ultra small screens - only for very old/small phones */
@media (max-width: 320px) {
  /* Compact space optimization */
  .next-shift-card .shift-item {
    padding: 10px 12px;
    min-height: 65px;
  }

  .next-shift-card .shift-amount-wrapper {
    margin-left: 6px;
  }

  /* Font sizes no longer need reduction due to shorter date text */
  /* .next-shift-card .shift-date font-size removed - using default size */

  .next-shift-card .shift-date-weekday {
    margin-right: 1px;
    font-size: var(--text-lg) !important; /* Maintain 18px font size on ultra small screens */
  }

  .next-shift-card .shift-date-separator {
    margin: 0 2px;
  }

  .next-shift-card .shift-countdown-timer {
    font-size: 0.85em;
  }

  /* Compact time display */
  .next-shift-card .shift-time-with-hours {
    gap: 1px;
    font-size: 12px;
  }

  .next-shift-card .shift-time-arrow {
    margin: 0 2px;
  }

  /* Keep amount section readable */
  .next-shift-card .shift-total {
    font-size: 15px;
  }

  .next-shift-card .shift-breakdown {
    font-size: 10px;
  }

  /* Ultra compact payroll card optimization */
  .next-payroll-card .payroll-item {
    padding: 10px 12px;
    min-height: 65px;
  }

  .next-payroll-card .shift-amount-wrapper {
    margin-left: 6px;
  }

  .next-payroll-card .shift-date {
    font-size: 12px;
  }

  .next-payroll-card .shift-date-weekday {
    margin-right: 1px;
  }

  .next-payroll-card .shift-time-with-hours {
    gap: 1px;
    font-size: 12px;
  }

  .next-payroll-card .shift-total {
    font-size: 15px;
  }

  .next-payroll-card .shift-breakdown {
    font-size: 10px;
  }
}



.shift-section .shift-list {
  padding-bottom: 20px;
}




/* Ensure proper layout on mobile */
@media (max-width: 768px) {
  .dashboard-content {
    padding-top: 15px;
    padding-bottom: 15px;
  }

  /* Adjust month navigation spacing for mobile */
  .dashboard-content .month-navigation-container {
    padding-top: 20px; /* Further reduced top padding on mobile */
    padding-bottom: 20px; /* Further reduced bottom padding on mobile */
    min-height: 70px; /* Further reduced minimum height on mobile */
  }

  /* Responsive month navigation button sizing for mobile */
  .month-nav-btn {
    width: 44px; /* Slightly smaller on mobile but still touch-friendly */
    height: 44px;
    font-size: var(--text-base); /* Reduce font size slightly on mobile */
  }

  .month-nav-btn .icon-sm {
    width: 18px; /* Slightly smaller icons on mobile */
    height: 18px;
  }

  .month-display {
    font-size: var(--text-lg); /* Reduced by one size from text-xl */
    min-width: 110px; /* Reduce width on mobile */
    letter-spacing: -0.005em; /* Adjust letter spacing for smaller text */
  }

  .section-header {
    padding: 15px 0;
    margin-bottom: 15px;
  }

  .section-header h2 {
    font-size: 20px;
  }

  .compact-view .total-amount {
    font-size: 2rem; /* 32px on mobile compact view */
    font-weight: var(--font-weight-extrabold); /* Maintain prominence in compact view */
    letter-spacing: -0.02em; /* Consistent letter spacing */
  }

  .compact-view .total-label {
    font-weight: var(--font-weight-semibold); /* Consistent hierarchy */
    letter-spacing: 0.025em;
    text-transform: uppercase;
  }

  .compact-view .total-secondary-info {
    font-weight: var(--font-weight-medium); /* Consistent hierarchy */
    font-size: 14px; /* Increased from default for mobile compact view */
    letter-spacing: -0.005em;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the entire content */
    gap: 6px; /* Space between amount and descriptive text */
  }
}

/* Large mobile devices and tablets - ensure month navigation remains visible */
@media (min-width: 481px) and (max-width: 768px) {
  .dashboard-content {
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 16px;
  }

  .dashboard-content .month-navigation-container {
    padding-top: 16px;
    padding-bottom: 16px;
    min-height: 60px;
  }

  /* Statistics section for large mobile */
  .statistics-content {
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 16px;
  }
}

/* Very large mobile devices (iPad portrait) - optimize for viewport usage */
@media (min-width: 769px) and (max-width: 1023px) and (orientation: portrait) {
  .dashboard-content {
    gap: 18px;
  }

  .dashboard-content .month-navigation-container {
    padding-top: 24px;
    padding-bottom: 24px;
    min-height: 80px;
  }

  /* Statistics section for iPad portrait */
  .statistics-content {
    gap: 18px;
  }
}

/* Mobile landscape and very short viewports - aggressive space optimization */
@media (max-height: 600px) and (orientation: landscape) {
  .dashboard-content {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 12px;
  }

  .dashboard-content .month-navigation-container {
    padding-top: 12px;
    padding-bottom: 12px;
    min-height: 50px;
  }

  /* Statistics section for landscape short viewports */
  .statistics-content {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 12px;
  }
}

/* Adjust header position for snap sections */
.snap-section .header {
  position: relative;
  top: 0;
  border-radius: 0 0 24px 24px;
}



/* Compact view styles - applied when body has .compact-view class */
.compact-view .shift-item {
  padding: 12px;
  min-height: 60px;
}

.compact-view .shift-date {
  font-size: 14px;
  margin-bottom: 4px;
}

.compact-view .shift-details {
  font-size: 12px;
}

.compact-view .shift-breakdown {
  font-size: 11px;
}

.compact-view .total-card {
  padding: 16px;
}

.compact-view .total-amount {
  font-size: 2.5rem; /* 40px - proportionally larger than previous 28px */
  font-weight: var(--font-weight-extrabold); /* Maintain prominence in compact view */
  letter-spacing: -0.02em; /* Consistent letter spacing */
}

.compact-view .total-label {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.compact-view .total-secondary-info {
  font-size: 16px; /* Increased from 11px to be more prominent in compact view */
  font-weight: var(--font-weight-medium);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  justify-content: center; /* Center the entire content */
  gap: 6px; /* Space between amount and descriptive text */
}







.compact-view .gap-20 {
  gap: 15px;
}

.compact-view .dashboard-content {
  gap: 15px;
  padding-top: 15px;
  padding-bottom: 15px;
}

/* Adjust month navigation spacing for compact view */
.compact-view .dashboard-content .month-navigation-container {
  padding-top: 20px; /* Further reduced top padding in compact view */
  padding-bottom: 20px; /* Further reduced bottom padding in compact view */
  min-height: 70px; /* Further reduced minimum height in compact view */
}

/* Compact view month navigation sizing */
.compact-view .month-nav-btn {
  width: 42px; /* Slightly smaller in compact view */
  height: 42px;
}

.compact-view .month-nav-btn .icon-sm {
  width: 17px; /* Proportionally smaller icons */
  height: 17px;
}

.compact-view .month-display {
  font-size: var(--text-lg); /* Reduced by one size from text-xl */
  min-width: 100px; /* Reduce width in compact view */
  font-weight: var(--font-weight-medium); /* Reduce weight for compact hierarchy */
}

/* Export period options styles - 2x2 grid layout */
.export-period-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px; /* Section spacing */
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Make the form-row container full width for export options */
.form-group:has(.export-period-options) .form-row {
  display: block; /* Override grid layout */
  width: 100%;
  margin: 0;
}

/* Ensure export period options use full modal width in settings */
#settingsModal .export-period-options {
  max-width: none;
  width: 100%;
}

.radio-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px; /* Increased spacing between radio and text */
  cursor: pointer;
  padding: 14px 16px; /* Optimized padding for better alignment */
  border-radius: 12px;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  transition: all var(--speed-normal) var(--ease-default);
  position: relative;
  overflow: hidden;
  min-height: 48px; /* Consistent height for proper alignment */
}

.radio-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  opacity: 0;
  transition: opacity var(--speed-normal) var(--ease-default);
  z-index: 0;
}

.radio-option:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background-color: rgba(255, 255, 255, 0.02);
}

.radio-option:hover::before {
  opacity: 0.03;
}

/* Custom radio button styling */
.radio-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg-primary);
  position: relative;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
  z-index: 1;
  vertical-align: middle; /* Align with text baseline */
  flex-shrink: 0; /* Prevent radio from shrinking */
}

.radio-option input[type="radio"]:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.radio-option input[type="radio"]:checked {
  border-color: rgba(99, 102, 241, 0.8);
  background: rgba(99, 102, 241, 0.8);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 50%;
}

.radio-option span {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  z-index: 1;
  transition: color var(--speed-normal) var(--ease-default);
  line-height: 1.2; /* Controlled line height */
  vertical-align: middle; /* Align with radio button baseline */
}

.radio-option input[type="radio"]:checked + span {
  color: var(--accent);
  font-weight: 600;
}

/* Selected state styling */
.radio-option:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(16, 185, 129, 0.05));
}

.radio-option:has(input[type="radio"]:checked)::before {
  opacity: 0.1;
}

/* ============================================================================
   EXPORT SECTION STYLING
   ============================================================================ */

/* Export section header */
.export-section-header,
.custom-period-header {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 0;
}

/* Export buttons container */
.export-buttons-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px; /* Proper spacing from hint */
}

/* Custom period section spacing */
#customPeriodSection .form-row {
  margin-top: 16px; /* Same spacing as export buttons from hint */
}

/* Data export buttons styling */
#exportOptionsSection .btn {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
  border: 2px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--speed-normal) var(--ease-default);
  position: relative;
  overflow: hidden;
}

#exportOptionsSection .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  opacity: 0;
  transition: opacity var(--speed-normal) var(--ease-default);
  z-index: 0;
}

#exportOptionsSection .btn:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background-color: rgba(255, 255, 255, 0.02);
  color: rgba(99, 102, 241, 0.8);
}

#exportOptionsSection .btn:hover::before {
  opacity: 0.1;
}

#exportOptionsSection .btn:hover svg {
  color: rgba(99, 102, 241, 0.8);
}

#exportOptionsSection .btn svg {
  width: 18px;
  height: 18px;
  transition: all var(--speed-normal) var(--ease-default);
  z-index: 1;
  position: relative;
}

#exportOptionsSection .btn span,
#exportOptionsSection .btn {
  position: relative;
  z-index: 1;
}

/* CSV button specific styling */
#exportOptionsSection .btn:first-child {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.05));
  border-color: rgba(99, 102, 241, 0.3);
}

#exportOptionsSection .btn:first-child:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* PDF button specific styling */
#exportOptionsSection .btn:last-child {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
  border-color: rgba(239, 68, 68, 0.3);
}

#exportOptionsSection .btn:last-child:hover {
  border-color: #ef4444;
  color: #ef4444;
}

#exportOptionsSection .btn:last-child:hover svg {
  color: #ef4444;
}

/* ============================================================================
   IMPORT SECTION - TONED DOWN STYLING
   ============================================================================ */

/* Import file input - less attention-grabbing */
input[type="file"].form-control {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  padding: 10px 12px;
  transition: all var(--speed-fast) var(--ease-default);
}

input[type="file"].form-control:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background-color: rgba(255, 255, 255, 0.02);
}

input[type="file"].form-control:focus {
  border-color: rgba(99, 102, 241, 0.4);
  background-color: rgba(255, 255, 255, 0.03);
}

/* Import button - subtle styling */
.form-group:has(input[type="file"]) .btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group:has(input[type="file"]) .btn:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(99, 102, 241, 0.3);
  color: rgba(255, 255, 255, 0.85);
}

/* Mobile responsive for export period options */
@media (max-width: 600px) {
  .export-period-options {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 6px;
  }

  .export-buttons-container {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .radio-option {
    padding: 12px 16px;
    gap: 14px;
    min-height: 48px;
  }

  .radio-option span {
    font-size: 13px;
  }

  .radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
  }

  #exportOptionsSection .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  #exportOptionsSection .btn svg {
    width: 16px;
    height: 16px;
  }

  .export-section-header {
    font-size: 15px;
  }
}

.switch-group .form-hint {
  margin-top: 4px; /* Tight spacing - directly related to switch text */
  margin-bottom: 0;
}

/* ============================================================================
   SPECIALIZED FORM ELEMENTS AND SECTIONS
   ============================================================================ */

/* Form groups with borders/separators need extra spacing */
.form-group[style*="border-top"] {
  padding-top: 24px; /* Major spacing after separator */
  margin-top: 24px; /* Major spacing before separator */
}

/* Wage level selector - part of larger form group */
#wageSelect {
  margin-bottom: 0; /* No extra spacing - part of form group */
}

/* Custom wage section - logical grouping */
#customWageSection {
  margin-top: 16px; /* Section spacing when visible */
}

/* Monthly goal input group - compact related elements */
#monthlyGoalInput {
  margin-bottom: 0; /* No extra spacing - part of switch group */
}

/* Special spacing for account tab separator */
.form-group[style*="border-top"] .form-row {
  margin-top: 0; /* No extra spacing - handled by form-group */
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS FOR MOBILE - SETTINGS MODAL SPACING
   ============================================================================ */

@media (max-width: 600px) {
  #settingsModal .tab-content {
    padding: 20px 16px 16px 16px; /* Slightly reduced padding on mobile */
  }

  .form-group {
    margin-bottom: 20px; /* Slightly tighter on mobile */
  }

  .form-actions {
    margin-top: 24px; /* Reduced final spacing on mobile */
  }
}

@media (max-width: 480px) {
  #settingsModal .tab-content {
    padding: 16px 12px 12px 12px; /* Compact padding on small screens */
  }

  .switch-group {
    gap: 12px; /* Tighter spacing on mobile */
  }

  .form-group {
    margin-bottom: 16px; /* Tighter spacing on mobile */
  }
}

/* Neste badge styling */
.next-shift-badge {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(135deg,
    rgba(0, 245, 255, 0.12) 0%,
    rgba(0, 212, 255, 0.12) 50%,
    rgba(58, 190, 246, 0.12) 100%); /* Same as payroll badge for consistency */
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  z-index: 2; /* Higher z-index to ensure it's above backdrop-filter */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Create flat left edges, rounded right edge (reversed due to 180deg rotation) */
  border-radius: 0 24px 24px 0;

  /* Text rotation - bottom facing inward */
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

/* Next payroll badge styling */
.next-payroll-badge {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(135deg,
    rgba(0, 245, 255, 0.12) 0%,
    rgba(0, 212, 255, 0.12) 50%,
    rgba(58, 190, 246, 0.12) 100%); /* Slightly more opaque than default to match shift badge appearance */
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  z-index: 2; /* Higher z-index to ensure it's above backdrop-filter */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Create flat left edges, rounded right edge (reversed due to 180deg rotation) */
  border-radius: 0 24px 24px 0;

  /* Text rotation - bottom facing inward */
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

/* Responsive border radius for neste badge to match card */
@media (max-width: 480px) {
  .next-shift-badge {
    border-radius: 0 20px 20px 0;
  }

  .next-payroll-badge {
    border-radius: 0 20px 20px 0;
  }
}

@media (max-width: 360px) {
  .next-shift-badge {
    border-radius: 0 16px 16px 0;
  }

  .next-payroll-badge {
    border-radius: 0 16px 16px 0;
  }
}

/* ============================================================================
   DATA TAB SPECIFIC STYLING - IMPROVED LAYOUT AND PADDING
   ============================================================================ */

/* Data tab gets more generous padding due to complex content structure */
#dataTab {
  padding: 32px 24px 24px 24px !important; /* More top padding for breathing room */
}

/* Data tab section headers need more prominent styling */
#dataTab .form-group > label {
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* Export options section - combined container for all export functionality */
#exportOptionsSection {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 32px; /* More space before import section */
  margin-top: 16px;
}

#exportOptionsSection .export-section-header {
  margin-bottom: 8px;
  margin-top: 0;
}

#exportOptionsSection > .form-hint {
  margin-bottom: 20px; /* More space before period options */
  margin-top: 0;
}

/* Export period options within the combined container */
#exportOptionsSection .export-period-options {
  margin-top: 0;
  margin-bottom: 20px; /* Space before custom period or buttons */
}

/* Custom period section within the combined container */
#exportOptionsSection #customPeriodSection {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  margin-top: 16px;
}

#exportOptionsSection #customPeriodSection .custom-period-header {
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
}

#exportOptionsSection #customPeriodSection .form-hint {
  margin-bottom: 16px;
  margin-top: 0;
}

#exportOptionsSection #customPeriodSection .form-row {
  margin-top: 0;
  margin-bottom: 0;
}

/* Export buttons within the combined container */
#exportOptionsSection .export-buttons-container {
  margin-top: 0;
  margin-bottom: 0;
}

/* Import section - better visual separation at bottom */
#dataTab .form-group:last-child {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 0;
  margin-top: 24px;
}

#dataTab .form-group:last-child > label {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 8px;
}

#dataTab .form-group:last-child .form-hint {
  margin-bottom: 0;
}

#dataTab .form-group:last-child .form-row {
  margin-top: 16px;
  margin-bottom: 0;
}

/* Mobile responsive adjustments for data tab */
@media (max-width: 600px) {
  #dataTab {
    padding: 24px 16px 16px 16px !important;
  }

  #exportOptionsSection,
  #dataTab .form-group:last-child {
    padding: 16px;
    margin-left: -4px;
    margin-right: -4px;
  }

  #exportOptionsSection #customPeriodSection {
    padding: 12px;
    margin-left: -4px;
    margin-right: -4px;
  }

  #dataTab .form-group > label {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  #dataTab {
    padding: 20px 12px 12px 12px !important;
  }

  #exportOptionsSection,
  #dataTab .form-group:last-child {
    padding: 12px;
    margin-left: -8px;
    margin-right: -8px;
  }

  #exportOptionsSection #customPeriodSection {
    padding: 8px;
    margin-left: -4px;
    margin-right: -4px;
  }
}

/* Adjust shift-info padding to make room for the badge */
.next-shift-card .shift-item .shift-info {
  padding-left: 32px; /* Add extra padding to prevent overlap with badge (32px width + 6px spacing) */
}

/* Adjust payroll-info padding to make room for the badge */
.next-payroll-card .payroll-item .shift-info {
  padding-left: 32px; /* Add extra padding to prevent overlap with badge (32px width + 6px spacing) */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ensure payroll card amount wrapper has proper styling */
.next-payroll-card .shift-amount-wrapper {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: 16px;
  flex-shrink: 0;
}

/* Weekly Hours Chart Card Styling */
.weekly-hours-chart-card {
  /* iOS-style translucent background matching header and total card */
  background: rgba(18, 18, 18, 0.75); /* Semi-transparent background to allow content to show through */
  backdrop-filter: blur(20px) saturate(180%); /* Enhanced blur with saturation for iOS-like effect */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  padding: 16px;
  border: 1px solid rgba(42, 42, 47, 0.6); /* More transparent border matching header */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  /* spacing now handled by parent gap */
  margin-top: 0;
  flex: 1;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  transition: all var(--speed-normal) var(--ease-default);
  width: 100%;
  /* Handle viewport changes smoothly */
  overflow: hidden;
  /* Use standard height behavior */
  height: auto;
}

.weekly-hours-chart-card:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Flex container for the two cards */
.chart-cards-container {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

/* Bar Chart Visualization Card */
.chart-visualization-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease-out;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chart-visualization-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05);
}

/* Hours Section - Container for Two Stacked Cards */
.chart-hours-section {
  flex: 0 0 auto;
  width: 130px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Total Hours Value Card */
.chart-hours-value-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-hours-value-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05);
}

/* Shift Count Card */
.chart-shifts-count-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-shifts-count-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05);
}

/* Content styling for the cards */
.hours-value-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.hours-value-number {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1;
}

.hours-value-label {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1;
}

.shifts-count-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.shifts-count-number {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1;
}

.shifts-count-label {
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1;
}

.chart-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  /* Smooth transition when height changes */
  transition: height 0.3s ease-out;
}

.chart-content {
  display: flex;
  align-items: flex-end;
  flex: 1;
}



.chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 8px 8px 8px;
  height: 160px; /* Fixed height for percentage calculations */
  gap: 4px;
  border-radius: 8px;
  position: relative;
}

.chart-bar {
  background: linear-gradient(135deg, #0A2A3A 0%, #023047 100%);
  border-radius: 8px 8px 0 0;
  min-width: 28px;
  width: calc((100% - 32px) / var(--total-weeks, 4)); /* Dynamic width based on week count */
  max-width: 120px; /* Prevent bars from becoming too wide when few bars are present */
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease-out;
  transform-origin: bottom;
  will-change: transform, height;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
  /* Set height based on calculated percentage */
  height: var(--bar-height, 0%);
  animation: barGrowth 0.25s ease-out forwards;
  animation-fill-mode: forwards;
}

/* Minimum height for bars with data - but allow smaller heights for proportional display */
.chart-bar.has-data {
  min-height: 8px;
}

/* Zero-hour bars should be completely transparent */
.chart-bar:not(.has-data) {
  background: transparent;
  box-shadow: none;
  cursor: default;
}

/* Bar growth animation */
@keyframes barGrowth {
  from {
    height: 0px;
    opacity: 0.7;
  }
  to {
    height: var(--bar-height, 0px);
    opacity: 1;
  }
}

/* Hour value fade-in animation */
@keyframes valueFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
  to {
    opacity: 0.9;
    transform: translateX(-50%) translateY(0);
  }
}

.chart-bar:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.15),
    inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #0E3A4A 0%, #034A5F 100%);
}

/* Highlight bar with most hours - subtle glass effect */
.chart-bar.highest {
  background: linear-gradient(135deg, #0A2A3A 0%, #023047 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 1px 0 1px rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.25),
    inset -1px 0 1px rgba(0, 0, 0, 0.1);
}

/* Current week highlighting - clean accent color */
.chart-bar.current-week {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 1px 0 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2),
    inset -1px 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Current week hover state */
.chart-bar.current-week:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* Current week bar value styling */
.chart-bar.current-week .chart-bar-value {
  color: var(--bg-primary);
  font-weight: var(--font-weight-bold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}



/* Special styling when current week is also the highest week */
.chart-bar.current-week.highest {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #0A2A3A 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 1px 0 1px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px rgba(0, 0, 0, 0.25),
    inset -1px 0 1px rgba(0, 0, 0, 0.15);
}

/* Styling for chart bars representing days with shifts from adjacent months */
.chart-bar.adjacent-month {
  background: linear-gradient(135deg, #2A2A2A 0%, #1A1A1A 100%);
  opacity: 0.6;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    inset 1px 0 1px rgba(255, 255, 255, 0.05),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2),
    inset -1px 0 1px rgba(0, 0, 0, 0.1);
}

.chart-bar.adjacent-month:hover {
  background: linear-gradient(135deg, #3A3A3A 0%, #2A2A2A 100%);
  opacity: 0.8;
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.25);
}

.chart-bar.adjacent-month .chart-bar-value {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Styling for wage cards with tooltips indicating excluded shifts */
.chart-shifts-count-card.has-tooltip,
.chart-hours-value-card.has-tooltip {
  position: relative;
  border-color: rgba(255, 193, 7, 0.3);
  background: linear-gradient(135deg,
    var(--bg-card) 0%,
    rgba(255, 193, 7, 0.02) 100%);
  cursor: pointer;
}

.chart-shifts-count-card.has-tooltip:hover,
.chart-hours-value-card.has-tooltip:hover {
  border-color: rgba(255, 193, 7, 0.5);
  background: linear-gradient(135deg,
    var(--bg-card) 0%,
    rgba(255, 193, 7, 0.04) 100%);
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(255, 193, 7, 0.1),
    inset 0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Add a larger, more prominent indicator icon for cards with tooltips */
.chart-shifts-count-card.has-tooltip::after,
.chart-hours-value-card.has-tooltip::after {
  content: 'i';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 16px;
  height: 16px;
  font-size: 11px;
  color: rgba(255, 193, 7, 0.9);
  font-weight: bold;
  font-style: italic;
  font-family: 'Times New Roman', serif;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 193, 7, 0.15);
  border-radius: 50%;
  border: 1px solid rgba(255, 193, 7, 0.4);
  line-height: 1;
  text-align: center;
}

/* Custom tooltip for wage cards */
.wage-card-tooltip {
  position: absolute;
  background: linear-gradient(135deg,
    rgba(10, 42, 58, 0.95) 0%,
    rgba(2, 48, 71, 0.95) 50%,
    rgba(26, 26, 29, 0.95) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 1002; /* Higher than chart tooltip */
  white-space: normal;
  max-width: min(280px, calc(100vw - 32px));
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(255, 193, 7, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-8px) scale(0.95);
  opacity: 0;
  transition: all 0.25s ease-out;
  text-align: left;
  line-height: 1.4;
}

.wage-card-tooltip.show {
  opacity: 1;
  transform: translateY(-12px) scale(1);
}

/* Responsive adjustments for tooltip indicators */
@media (max-width: 480px) {
  .chart-shifts-count-card.has-tooltip::after,
  .chart-hours-value-card.has-tooltip::after {
    width: 14px;
    height: 14px;
    font-size: 9px;
    top: 4px;
    right: 6px;
  }

  .wage-card-tooltip {
    font-size: 11px;
    padding: 10px 12px;
    max-width: calc(100vw - 32px);
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .chart-shifts-count-card.has-tooltip::after,
  .chart-hours-value-card.has-tooltip::after {
    width: 12px;
    height: 12px;
    font-size: 8px;
    top: 3px;
    right: 5px;
  }

  .wage-card-tooltip {
    font-size: 10px;
    padding: 8px 10px;
    max-width: calc(100vw - 24px);
    white-space: normal;
  }
}

.chart-bar-value {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #4AC8FF;
  white-space: nowrap;
  opacity: 0;
  letter-spacing: 0.02em;
  animation: valueFadeIn 0.2s ease-out 0.35s forwards; /* Delay after bar animation */
}

.chart-labels {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px 0 8px;
  gap: 4px;
}

.chart-label {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  min-width: 28px;
  /* Match the exact width calculation used by chart bars */
  width: calc((100% - 32px) / var(--total-weeks, 4));
  max-width: 120px; /* Match chart-bar max-width for perfect alignment */
  transform: none;
  transform-origin: center;
  /* Ensure perfect alignment with bars */
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

/* Current week label highlighting - matches bar color */
.chart-label.current-week {
  color: var(--primary);
}

/* Progress bar wrapper for drill-down back button positioning */
.progress-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px; /* Reduced gap for mobile */
}

.progress-bar-wrapper .chart-progress-bar {
  flex: 1;
  margin-top: 20px;
  min-width: 0; /* Allow shrinking below content size */
}

/* Drill-down back button - positioned to the right of progress bar, width matches stat cards */
.drill-down-back-button {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  height: 52px;
  flex-shrink: 0;
  margin-top: 20px;
  width: 130px; /* Match default chart-hours-section width */
  position: relative;
}

.drill-down-back-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.drill-down-back-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.drill-down-back-button .back-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.drill-down-back-button span {
  color: var(--text-secondary);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
}

/* Responsive adjustments for back button and wrapper - match chart-hours-section widths exactly */

/* Very small mobile devices */
@media (max-width: 320px) {
  .progress-bar-wrapper {
    gap: 6px; /* Minimal gap for very small screens */
  }

  .progress-bar-wrapper .chart-progress-bar {
    margin-top: 8px;
  }

  .drill-down-back-button {
    padding: 4px 6px;
    font-size: 11px;
    height: 42px;
    margin-top: 8px;
    border-radius: 10px;
    width: 75px; /* Match chart-hours-section width */
  }

  .drill-down-back-button .back-icon {
    width: 10px;
    height: 10px;
    left: 6px; /* Adjust for smaller padding */
  }
}

/* Small mobile devices */
@media (max-width: 360px) {
  .progress-bar-wrapper {
    gap: 6px; /* Small gap for small screens */
  }

  .progress-bar-wrapper .chart-progress-bar {
    margin-top: 8px;
  }

  .drill-down-back-button {
    padding: 4px 6px;
    font-size: 12px;
    height: 42px;
    margin-top: 8px;
    border-radius: 10px;
    width: 80px; /* Match chart-hours-section width */
  }

  .drill-down-back-button .back-icon {
    width: 12px;
    height: 12px;
    left: 6px; /* Adjust for smaller padding */
  }
}

/* Medium mobile devices */
@media (max-width: 480px) {
  .progress-bar-wrapper .chart-progress-bar {
    margin-top: 10px;
  }

  .drill-down-back-button {
    padding: 6px 8px;
    font-size: 13px;
    height: 46px;
    margin-top: 10px;
    border-radius: 12px;
    width: 85px; /* Match chart-hours-section width */
  }

  .drill-down-back-button .back-icon {
    width: 14px;
    height: 14px;
    left: 8px; /* Adjust for padding */
  }
}

/* Additional responsive breakpoints to match chart-hours-section widths exactly */

/* Larger mobile devices */
@media (max-width: 600px) {
  .drill-down-back-button {
    width: 90px; /* Match chart-hours-section width */
  }
}

/* Large mobile and small tablets */
@media (min-width: 481px) and (max-width: 767px) {
  .drill-down-back-button {
    width: 115px; /* Match chart-hours-section width */
  }
}

/* Tablet portrait - smaller devices */
@media (max-width: 480px) {
  .drill-down-back-button {
    width: 100px; /* Match chart-hours-section width */
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .drill-down-back-button {
    width: 65px; /* Match chart-hours-section width for landscape */
    padding: 4px 6px;
    font-size: 11px;
  }

  .drill-down-back-button .back-icon {
    width: 10px;
    height: 10px;
    left: 6px; /* Adjust for smaller padding */
  }
}

/* Desktop and larger screens */
@media (min-width: 768px) {
  .progress-bar-wrapper {
    gap: 12px; /* Comfortable gap for desktop */
  }

  .progress-bar-wrapper .chart-progress-bar {
    margin-top: 24px;
  }

  .drill-down-back-button {
    height: 58px;
    margin-top: 24px;
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 16px;
    width: 140px; /* Match chart-hours-section width */
  }

  .drill-down-back-button .back-icon {
    width: 18px;
    height: 18px;
    left: 12px; /* Match default padding */
  }
}

/* Large desktop screens - keep same width as 768px+ since chart-hours-section stays 140px */
@media (min-width: 1024px) {
  .drill-down-back-button {
    width: 140px; /* Match chart-hours-section width (stays 140px on desktop) */
  }
}

.chart-tooltip {
  position: absolute;
  background: linear-gradient(135deg,
    rgba(10, 42, 58, 0.95) 0%,
    rgba(2, 48, 71, 0.95) 50%,
    rgba(26, 26, 29, 0.95) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(74, 200, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 1001; /* Higher than chart bars */
  white-space: nowrap;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(74, 200, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-12px) scale(0.95);
  opacity: 0;
  transition: all 0.25s ease-out;
  min-width: 140px;
  text-align: left;
  /* Ensure tooltip doesn't interfere with scrolling */
  will-change: transform, opacity;
}

.chart-tooltip-line {
  display: block;
  margin: 3px 0;
  line-height: 1.4;
}

.chart-tooltip-line:first-child {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  font-size: 14px;
}

.chart-tooltip-line:last-child {
  font-weight: 700;
  color: var(--accent);
  margin-top: 6px;
  font-size: 14px;
}

.chart-tooltip.show {
  opacity: 1;
  transform: translateY(-16px) scale(1);
}

/* Enhanced styling for active tooltip bars */
.chart-bar.tooltip-active {
  transform: translateY(-3px);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(74, 200, 255, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #0E3A4A 0%, #034A5F 100%);
  z-index: 10;
  position: relative;
  /* Add subtle neon glow for active state */
  border: 1px solid rgba(74, 200, 255, 0.3);
}



/* Responsive adjustments for weekly hours chart */
@media (max-width: 480px) {
  .weekly-hours-chart-card {
    padding: 14px;
    border-radius: 20px;
    min-height: 220px;
  }

  .chart-cards-container {
    gap: 8px;
  }

  .chart-visualization-card {
    padding: 10px;
    border-radius: 12px;
  }

  .chart-hours-section {
    width: 100px;
    gap: 6px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 10px;
    border-radius: 12px;
  }

  .hours-value-number {
    font-size: 20px;
  }

  .hours-value-label {
    font-size: 12px;
  }

  .shifts-count-number {
    font-size: 20px;
  }

  .shifts-count-label {
    font-size: 12px;
  }

  .chart-bars {
    height: 120px; /* Fixed height for mobile */
    gap: 3px;
    padding: 12px 6px 6px 6px;
  }

  .chart-content {
    gap: 8px;
  }



  .chart-bar {
    min-width: 24px;
    max-width: 80px; /* Smaller max-width for mobile */
    border-radius: 6px 6px 0 0;
  }

  .chart-bar.has-data {
    min-height: 36px;
  }

  .chart-bar-value {
    font-size: 12px;
    bottom: 10px;
  }

  .chart-labels {
    padding: 4px 6px 0 6px;
    justify-content: center;
    gap: 3px;
  }

  .chart-label {
    font-size: 12px;
    min-width: 24px;
    max-width: 80px; /* Match chart-bar max-width for mobile */
    font-weight: 700;
    transform: none;
  }

  /* Current week mobile adjustments - no changes needed, uses base styling */

  /* Mobile tooltip adjustments */
  .chart-tooltip {
    font-size: 12px;
    padding: 10px 12px;
    min-width: 120px;
    border-radius: 10px;
    transform: translateY(-10px) scale(0.95);
  }

  .chart-tooltip.show {
    transform: translateY(-14px) scale(1);
  }

  .chart-tooltip-line:first-child {
    font-size: 13px;
  }

  .chart-tooltip-line:last-child {
    font-size: 13px;
  }

  /* Enhanced touch targets for mobile */
  .chart-bar.has-data {
    min-height: 40px; /* Larger touch target */
  }
}

@media (max-width: 360px) {
  .weekly-hours-chart-card {
    padding: 12px;
    border-radius: 16px;
    min-height: 200px;
  }

  .chart-cards-container {
    gap: 6px;
  }

  .chart-visualization-card {
    padding: 8px;
    border-radius: 10px;
  }

  .chart-hours-section {
    width: 90px;
    gap: 5px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 8px;
    border-radius: 10px;
  }

  .hours-value-number {
    font-size: 18px;
  }

  .hours-value-label {
    font-size: 10px;
  }

  .shifts-count-number {
    font-size: 18px;
  }

  .shifts-count-label {
    font-size: 10px;
  }

  .chart-bars {
    height: 100px; /* Fixed height for very small screens */
    gap: 2px;
    padding: 10px 4px 4px 4px;
  }

  .chart-content {
    gap: 6px;
  }



  .chart-bar {
    min-width: 20px;
    max-width: 60px; /* Even smaller max-width for very small screens */
    border-radius: 4px 4px 0 0;
  }

  .chart-bar.has-data {
    min-height: 32px;
  }

  .chart-bar-value {
    font-size: 10px;
    bottom: 8px;
  }

  .chart-labels {
    padding: 3px 4px 0 4px;
    justify-content: center;
    gap: 2px;
  }

  .chart-label {
    font-size: 10px;
    min-width: 20px;
    max-width: 60px; /* Match chart-bar max-width for very small screens */
    font-weight: 700;
    transform: none;
  }

  /* Current week very small mobile adjustments - no changes needed, uses base styling */

  /* Very small screen tooltip adjustments */
  .chart-tooltip {
    font-size: 11px;
    padding: 8px 10px;
    min-width: 100px;
    border-radius: 8px;
  }

  .chart-tooltip-line:first-child {
    font-size: 12px;
  }

  .chart-tooltip-line:last-child {
    font-size: 12px;
  }

  /* Enhanced touch targets for very small screens */
  .chart-bar.has-data {
    min-height: 36px; /* Even larger touch target for small screens */
  }
}

/* Large mobile devices and small tablets - balance between mobile and desktop */
@media (min-width: 481px) and (max-width: 767px) {
  .weekly-hours-chart-card {
    padding: 16px;
    border-radius: 24px;
    min-height: 240px;
  }

  .chart-cards-container {
    gap: 10px;
  }

  .chart-visualization-card {
    padding: 12px;
    border-radius: 14px;
  }

  .chart-hours-section {
    width: 115px;
    gap: 7px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 12px;
    border-radius: 14px;
  }

  .hours-value-number {
    font-size: 22px;
  }

  .hours-value-label {
    font-size: 15px;
  }

  .shifts-count-number {
    font-size: 22px;
  }

  .shifts-count-label {
    font-size: 15px;
  }

  .chart-bars {
    height: 140px; /* Fixed height for tablet */
    gap: 6px;
    padding: 16px 10px 8px 10px;
  }

  .chart-content {
    gap: 10px;
  }

  .chart-labels {
    justify-content: center;
    gap: 6px;
  }

  .chart-progress-bar {
    height: 50px;
    margin-top: 18px;
    border-radius: 14px;
  }

  .chart-progress-fill {
    border-radius: 14px 0 0 14px;
  }

  .chart-progress-fill.full {
    border-radius: 14px;
  }
}

/* For larger screens - enhanced styling */
@media (min-width: 768px) {
  .weekly-hours-chart-card {
    padding: 20px;
    border-radius: 28px;
    min-height: 310px;
  }

  .chart-cards-container {
    gap: 14px;
  }

  .chart-visualization-card {
    padding: 16px;
    border-radius: 18px;
  }

  .chart-hours-section {
    width: 140px;
    gap: 10px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 16px;
    border-radius: 18px;
  }

  .hours-value-number {
    font-size: 26px;
  }

  .hours-value-label {
    font-size: 16px;
  }

  .shifts-count-number {
    font-size: 26px;
  }

  .shifts-count-label {
    font-size: 16px;
  }

  .chart-bars {
    height: 180px; /* Fixed height for desktop */
    gap: 8px;
    padding: 20px 12px 10px 12px;
  }

  .chart-content {
    gap: 14px;
  }



  .chart-bar {
    min-width: 36px;
    max-width: 140px; /* Larger max-width for desktop */
    border-radius: 10px 10px 0 0;
  }

  .chart-bar.has-data {
    min-height: 48px;
  }

  .chart-bar-value {
    font-size: 16px;
    bottom: 14px;
  }

  .chart-labels {
    padding: 8px 12px 0 12px;
    justify-content: center;
    gap: 8px;
  }

  .chart-label {
    font-size: 16px;
    min-width: 36px;
    max-width: 140px; /* Match chart-bar max-width for desktop */
    font-weight: 700;
    transform: none;
  }

  /* Current week desktop enhancements - no changes needed, uses base styling */
}

/* Handle very short viewports (mobile browser UI expanded) */
@media (max-height: 500px) {
  .weekly-hours-chart-card {
    /* Reduce padding on very short screens */
    padding: 10px;
    min-height: 170px;
  }

  .chart-cards-container {
    gap: 6px;
  }

  .chart-visualization-card {
    padding: 8px;
    border-radius: 10px;
  }

  .chart-hours-section {
    width: 85px;
    gap: 4px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 8px;
    border-radius: 10px;
  }

  .hours-value-number {
    font-size: 16px;
  }

  .hours-value-label {
    font-size: 15px;
  }

  .shifts-count-number {
    font-size: 16px;
  }

  .shifts-count-label {
    font-size: 15px;
  }

  .chart-bars {
    min-height: 70px;
    max-height: 90px;
    padding: 8px 4px 4px 4px;
  }

  .chart-content {
    gap: 6px;
  }

  .chart-labels {
    justify-content: center;
    gap: 4px;
  }

  .chart-bar.has-data {
    min-height: 20px;
  }

  .chart-bar-value {
    font-size: 10px;
    bottom: 4px;
  }

  .chart-progress-bar {
    height: 40px;
    margin-top: 12px;
    border-radius: 10px;
  }

  .chart-progress-fill {
    border-radius: 10px 0 0 10px;
  }

  .chart-progress-fill.full {
    border-radius: 10px;
  }
}

/* Handle extremely short viewports (mobile landscape with browser UI) */
@media (max-height: 400px) {
  .weekly-hours-chart-card {
    padding: 8px;
    min-height: 150px;
  }

  .chart-cards-container {
    gap: 4px;
  }

  .chart-visualization-card {
    padding: 6px;
    border-radius: 8px;
  }

  .chart-hours-section {
    width: 80px;
    gap: 3px;
  }

  .chart-hours-value-card,
  .chart-shifts-count-card {
    padding: 6px;
    border-radius: 8px;
  }

  .hours-value-number {
    font-size: 14px;
  }

  .hours-value-label {
    font-size: 15px;
  }

  .shifts-count-number {
    font-size: 14px;
  }

  .shifts-count-label {
    font-size: 15px;
  }

  .chart-bars {
    min-height: 60px;
    max-height: 75px;
    padding: 6px 4px 4px 4px;
  }

  .chart-content {
    gap: 4px;
  }

  .chart-labels {
    justify-content: center;
    gap: 4px;
  }



  .chart-progress-bar {
    height: 36px;
    margin-top: 8px;
    border-radius: 8px;
  }

  .chart-progress-fill {
    border-radius: 8px 0 0 8px;
  }

  .chart-progress-fill.full {
    border-radius: 8px;
  }

  .chart-progress-label {
    font-size: var(--text-xs);
  }
}

/* ============================================================================
   INTEGRATED PROGRESS BAR - STREAMLINED DESIGN FOR CHART INTEGRATION
   ============================================================================ */

/* Integrated progress bar within chart container */
.chart-progress-bar {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0;
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  height: 52px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease-default);
  opacity: 1;
}

.chart-progress-bar:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Progress fill for integrated bar */
.chart-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #0A2A3A 0%, #023047 100%);
  border-radius: 12px 0 0 12px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
  position: relative;
  overflow: hidden;
  width: 0%;
  will-change: width;
}

/* Active progress fill - when nearing or completing goal */
.chart-progress-fill.active {
  background: linear-gradient(135deg, #0A2A3A 0%, #023047 100%);
}

/* Initial loading state */
.chart-progress-fill.loading {
  width: 0% !important;
  transition: none !important;
  animation: none !important;
}

.chart-progress-fill.full {
  border-radius: 12px;
}

/* Overachievement styling */
.chart-progress-fill.overachievement {
  background: var(--gradient-neon);
}

/* Progress label for integrated bar */
.chart-progress-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #4AC8FF;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
  width: 100%;
  text-align: center;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 0 8px rgba(0, 0, 0, 0.2);
  transition: all var(--speed-normal) var(--ease-default);
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Progress label states for integrated bar */
.chart-progress-label.low-progress {
  color: #4AC8FF;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 0 12px rgba(0, 0, 0, 0.3);
}

.chart-progress-label.medium-progress {
  color: #4AC8FF;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 0 8px rgba(0, 0, 0, 0.4),
    0 0 16px rgba(255, 255, 255, 0.1);
}

.chart-progress-label.high-progress {
  color: #4AC8FF;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 0, 0, 0.2);
}

.chart-progress-label.overachievement {
  color: #4AC8FF;
  font-weight: var(--font-weight-bold);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.7),
    0 0 12px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(58, 190, 246, 0.3);
  animation: subtle-glow 2s ease-in-out infinite alternate;
}

/* Responsive adjustments for integrated progress bar */
@media (max-width: 480px) {
  .chart-progress-bar {
    height: 46px;
    margin-top: 10px;
    border-radius: 12px;
  }

  .chart-progress-fill {
    border-radius: 12px 0 0 12px;
  }

  .chart-progress-fill.full {
    border-radius: 12px;
  }

  .chart-progress-label {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
    text-shadow:
      0 1px 3px rgba(0, 0, 0, 0.4),
      0 0 10px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 360px) {
  .chart-progress-bar {
    height: 42px;
    margin-top: 8px;
    border-radius: 10px;
  }

  .chart-progress-fill {
    border-radius: 10px 0 0 10px;
  }

  .chart-progress-fill.full {
    border-radius: 10px;
  }
}

@media (min-width: 768px) {
  .chart-progress-bar {
    height: 58px;
    margin-top: 24px;
    border-radius: 16px;
  }

  .chart-progress-fill {
    border-radius: 16px 0 0 16px;
  }

  .chart-progress-fill.full {
    border-radius: 16px;
  }

  .chart-progress-label {
    font-size: var(--text-base);
  }
}