/* Left Column Highlights Section */
.sidebar-highlights-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.sidebar-section-title {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sidebar-highlights-section .highlights-levels-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: 100% !important;
}

.sidebar-highlights-section .highlights-levels-grid.hidden {
  display: none !important;
}

.sidebar-highlights-section .hl-level-card {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 4px 5px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-subtle) !important;
  background: var(--bg-card-elevated) !important;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: unset !important;
}

.sidebar-highlights-section .hl-level-card:hover {
  background: #ffffff !important;
  border-color: var(--border-highlight) !important;
  transform: translateY(-1px);
}

.sidebar-highlights-section .hl-level-card.active {
  background: linear-gradient(135deg, rgba(47, 158, 119, 0.12), rgba(108, 122, 224, 0.06)) !important;
  border-left: 3px solid var(--accent-emerald) !important;
  border-color: var(--border-subtle) !important;
}

.sidebar-highlights-section .hl-level-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 2px !important;
}

.sidebar-highlights-section .hl-badge {
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  padding: 1px 3px !important;
  border-radius: 3px !important;
  background: rgba(47, 158, 119, 0.12) !important;
  color: var(--accent-emerald) !important;
  letter-spacing: 0.02em !important;
}

.sidebar-highlights-section .hl-sub {
  font-size: 0.58rem !important;
  color: var(--text-muted) !important;
  font-family: var(--font-mono) !important;
}

.sidebar-highlights-section .hl-metrics-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 2px 4px !important;
  font-size: 0.62rem !important;
  color: var(--text-muted) !important;
  line-height: 1.25 !important;
}

.sidebar-highlights-section .hl-metrics-row strong {
  font-size: 0.68rem !important;
  color: var(--text-primary) !important;
}

/* Left Column Perks Vault Dashboard Widget Tile */
.sidebar-perks-vault-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pv-sidebar-total-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

.pv-sidebar-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.pv-sidebar-tile:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.pv-sidebar-tile.has-red-alert {
  border-color: rgba(220, 38, 38, 0.55);
  border-left: 3px solid #dc2626;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.65), rgba(255, 255, 255, 0.95));
}

.pv-sidebar-red-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.58rem;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 2px 4px;
  animation: pulse-pv-red 2.2s infinite ease-in-out;
}

@keyframes pulse-pv-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.pv-sidebar-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pv-sidebar-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.61rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.pv-sidebar-group-row strong {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-primary);
}

.pv-sidebar-group-row.is-red strong {
  color: #dc2626;
}

.pv-sidebar-red-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 1px;
}

.pv-sidebar-red-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.58rem;
  font-weight: 600;
  color: #991b1b;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 3px;
  padding: 1px 4px;
}

.pv-sidebar-prompt-box {
  font-size: 0.57rem;
  line-height: 1.28;
  color: #7f1d1d;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(220, 38, 38, 0.4);
  border-radius: 4px;
  padding: 3px 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 5px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 38px;
  box-sizing: border-box;
}

.nav-tab:hover {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(47, 158, 119, 0.12), rgba(108, 122, 224, 0.08));
  color: var(--text-primary);
  font-weight: 700;
  border-color: var(--border-subtle);
  border-left: 3px solid var(--accent-emerald);
  box-shadow: 0 2px 8px rgba(47, 158, 119, 0.08);
}

.nav-tab-icon {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Dynamic Calendar Icon (Planner Navigation Tab) */
.nav-tab-icon-cal {
  font-size: 1rem;
  line-height: 1;
}

/* Colorful Stopwatch Icon (Time Logger Navigation Tab) */
.nav-tab-icon-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dynamic-timer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.16));
  transition: transform 0.18s ease, filter 0.18s ease;
}

.dynamic-timer-icon svg {
  width: 20px;
  height: 20px;
}

.nav-tab:hover .dynamic-timer-icon {
  transform: scale(1.08);
  filter: drop-shadow(0 2px 5px rgba(99, 102, 241, 0.35));
}

.nav-tab.active .dynamic-timer-icon {
  filter: drop-shadow(0 1px 4px rgba(47, 158, 119, 0.3));
}

.nav-tab.is-recording .dynamic-timer-icon {
  animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 7px var(--rec-pill-bg, #ef4444));
  }
}

.dynamic-cal-icon {
  display: inline-flex;
  flex-direction: column;
  width: 19px;
  height: 19px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  box-sizing: border-box;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dynamic-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 6.5px;
  background: #eb4d4b; /* Vibrant Apple Calendar red */
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
}

.dynamic-cal-date {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  background: #ffffff;
  color: #1f2937;
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  padding-bottom: 0.5px;
  box-sizing: border-box;
}

.nav-tab:hover .dynamic-cal-icon {
  transform: translateY(-0.5px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
}

.nav-tab.active .dynamic-cal-icon {
  border-color: rgba(47, 158, 119, 0.5);
  box-shadow: 0 1px 4px rgba(47, 158, 119, 0.22);
}

.nav-tab-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.planner-weather-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  padding: 1px 2px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  flex-shrink: 0;
}

.planner-weather-icon:hover {
  transform: scale(1.15);
  background: rgba(108, 122, 224, 0.15);
  border-color: rgba(108, 122, 224, 0.35);
  box-shadow: 0 1px 4px rgba(108, 122, 224, 0.2);
}

.nav-tab-pill {
  font-size: 0.64rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 999px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  line-height: 1.1;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab.active .nav-tab-pill {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
}

/* Health Nav Tab Sync Indicator Dot (similar to Life OS icon dot) */
.nav-tab-icon-health {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-tab-icon-health svg {
  width: 20px;
  height: 20px;
  display: block;
}

.nav-tab-icon-health .health-sync-indicator {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: 0 0 0 1.5px var(--bg-card), 0 1px 3px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  z-index: 5;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.nav-tab:hover .nav-tab-icon-health .health-sync-indicator {
  background: var(--bg-card-elevated);
  box-shadow: 0 0 0 1.5px var(--bg-card-elevated), 0 1px 3px rgba(0, 0, 0, 0.18);
}

.nav-tab.active .nav-tab-icon-health .health-sync-indicator {
  background: #eef8f4;
  box-shadow: 0 0 0 1.5px #eef8f4, 0 1px 3px rgba(0, 0, 0, 0.18);
}

.nav-tab-icon-health .health-sync-dot {
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  display: inline-block;
  background: #10b981;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.85);
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-tab-icon-health .health-sync-dot.status-yellow {
  background: #f59e0b;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.9);
  animation: pulse-backup-yellow 1.4s infinite ease-in-out;
}

.nav-tab-icon-health .health-sync-dot.status-red {
  background: #ef4444;
  box-shadow: 0 0 7px rgba(239, 68, 68, 0.95);
  animation: pulse-backup-red 1s infinite alternate;
}

.nav-tab-pill.pill-recording {
  background: var(--rec-pill-bg, #ef4444) !important;
  border-color: var(--rec-pill-bg, #ef4444) !important;
  color: var(--rec-pill-color, #ffffff) !important;
  animation: pulseRec 1.4s infinite;
  max-width: 145px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  box-shadow: 0 1px 8px var(--rec-glow-color, rgba(239, 68, 68, 0.35));
}

.nav-tab-pill.pill-mini-timer {
  background: var(--rec-pill-bg, #fde8ec) !important;
  border: 1.5px solid var(--rec-pill-border, rgba(225, 29, 72, 0.35)) !important;
  color: var(--rec-pill-color, #9f1239) !important;
  font-weight: 600;
  font-size: 0.68rem;
  padding: 2.5px 14px 2.5px 6px !important;
  border-radius: 999px;
  max-width: 116px;
  white-space: nowrap;
  overflow: visible !important;
  box-shadow: 0 1px 6px var(--rec-glow-color, rgba(225, 29, 72, 0.25));
  animation: slowPulseRecording 2.4s ease-in-out infinite !important;
  letter-spacing: 0.1px;
  display: inline-flex;
  align-items: center;
  position: relative !important;
}

.nav-tab-pill.pill-mini-timer .pill-timer-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 96px;
  line-height: 1.2;
}

.nav-tab-pill.pill-mini-timer .pill-timer-energy-icon {
  position: absolute !important;
  top: 1px !important;
  right: 4px !important;
  width: 11px !important;
  height: 11px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
  z-index: 2;
  filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.12));
}

.nav-tab-pill.pill-mini-timer .pill-timer-energy-icon .tl-lightning-svg {
  width: 11px !important;
  height: 11px !important;
  display: block;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.5;
}

/* Recording Mode in Sidebar Navigation: In expanded sidebar mode (>= 641px), dedicate all space to the activity & time display.
   In collapsed / folded mobile mode (<= 640px), keep icon mode like all other tabs. */
@media (min-width: 641px) {
  .left-sidebar:not(.collapsed) .nav-tab.is-recording .nav-tab-icon,
  .left-sidebar:not(.collapsed) .nav-tab.is-recording .nav-tab-icon-timer,
  .left-sidebar:not(.collapsed) .nav-tab.is-recording .dynamic-timer-icon {
    display: none !important;
  }

  .left-sidebar:not(.collapsed) .nav-tab.is-recording {
    gap: 0;
    padding: 5px 3px;
    justify-content: center;
  }

  .left-sidebar:not(.collapsed) .nav-tab.is-recording .nav-tab-pill.pill-recording {
    margin-left: 0;
    width: 100%;
    max-width: 100% !important;
    font-size: 0.72rem;
    padding: 3px 6px;
    letter-spacing: 0.1px;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
    animation: slowPulseRecording 2.4s ease-in-out infinite !important;
  }

  .left-sidebar:not(.collapsed) .nav-tab.is-recording .nav-tab-pill.pill-mini-timer {
    margin-left: 0;
    width: 100%;
    max-width: 100% !important;
    font-size: 0.72rem;
    padding: 3px 16px 3px 6px !important;
    letter-spacing: 0.1px;
    overflow: visible !important;
    box-sizing: border-box;
    justify-content: center;
    animation: slowPulseRecording 2.4s ease-in-out infinite !important;
  }

  .left-sidebar:not(.collapsed) .nav-tab.is-recording .nav-tab-pill.pill-mini-timer .pill-timer-text {
    max-width: calc(100% - 10px);
    text-align: center;
  }
}

.nav-tab.is-recording .nav-tab-label {
  display: none !important;
}

@keyframes slowPulseRecording {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 1px 6px var(--rec-glow-color, rgba(225, 29, 72, 0.25));
  }
  50% {
    opacity: 0.65;
    transform: scale(0.985);
    box-shadow: 0 0 12px var(--rec-glow-color, rgba(225, 29, 72, 0.5));
  }
}

@keyframes pulseRec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-sidebar-action {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 5px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
  box-sizing: border-box;
}

.btn-sidebar-action:hover {
  background: #ffffff;
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.btn-sidebar-chat {
  background: linear-gradient(135deg, rgba(108, 122, 224, 0.12), rgba(47, 158, 119, 0.08));
  border-color: rgba(108, 122, 224, 0.3);
  color: var(--accent-indigo);
}

.sidebar-sys-info {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Collapsed Sidebar Rules: strict icon-only display to prevent details bleeding */
.left-sidebar.collapsed .nav-tab-pill,
.left-sidebar.collapsed .nav-tab-pill.pill-recording,
.left-sidebar.collapsed .nav-tab-pill.pill-mini-timer,
.left-sidebar.collapsed #badge-nav-timer,
.left-sidebar.collapsed .planner-weather-icon,
.left-sidebar.collapsed .nav-tab-label {
  display: none !important;
}

.left-sidebar.collapsed .nav-tab {
  justify-content: center !important;
  align-items: center !important;
  padding: 9px 0 !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.left-sidebar.collapsed .nav-tab-icon {
  margin: 0 auto !important;
  flex-shrink: 0 !important;
}

.left-sidebar.collapsed .nav-tab.is-recording .nav-tab-icon,
.left-sidebar.collapsed .nav-tab.is-recording .nav-tab-icon-timer,
.left-sidebar.collapsed .nav-tab.is-recording .dynamic-timer-icon {
  display: inline-flex !important;
}

