/* Life OS Planner Tab Styles */

/* 2. Planner Master Card */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  box-shadow: 0 4px 18px rgba(80, 70, 50, 0.06);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.planner-master-card {
  padding: 14px 8px;
  margin-bottom: 16px;
}

.planner-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-bottom: none;
  padding-bottom: 2px;
  flex-wrap: wrap;
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .planner-topbar {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

.horizon-tabs {
  display: flex;
  background: var(--bg-card-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 3px;
  flex-shrink: 0;
}

.horizon-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}

.horizon-tab.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(108, 122, 224, 0.30);
}

.period-navigator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-arrow-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.nav-arrow-btn:hover {
  border-color: var(--accent-indigo);
  background: rgba(108, 122, 224, 0.10);
}

.period-title-display {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  padding: 0 3px;
}

.btn-today {
  background: rgba(47, 158, 119, 0.12) !important;
  border: 1px solid rgba(47, 158, 119, 0.35) !important;
  color: #1f7a5a !important;
  font-weight: 600;
  font-size: 0.78rem !important;
  padding: 4px 9px !important;
  border-radius: 6px !important;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.planner-weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.planner-weather-pill:hover {
  border-color: var(--accent-indigo);
  background: rgba(108, 122, 224, 0.08);
}

/* Planner Topbar Right-Aligned BEU Modifier */
.planner-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.planner-day-beu-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  height: 28px;
  box-sizing: border-box;
}

.beu-label-trigger {
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.beu-label-trigger:hover,
.beu-label-trigger.is-active {
  color: var(--text-primary);
  background: rgba(108, 122, 224, 0.08);
}

.beu-label-trigger .baseline-event-popover::before {
  right: 12px;
}

.rate-indicator {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Calendar Drill-Down Strip */
.horizon-calendar-container {
  background: var(--bg-subcard);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px;
}

.cal-hint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.week-strip-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.day-jump-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-jump-card:hover {
  border-color: var(--accent-indigo);
}

.day-jump-card.is-today {
  border-color: var(--accent-emerald);
  background: rgba(47, 158, 119, 0.08);
}

.day-jump-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}

.day-jump-today-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #1f7a5a;
  background: rgba(47, 158, 119, 0.16);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
}

.day-jump-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.month-cal-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.71rem;
}

.month-cal-cell.is-today {
  border-color: var(--accent-emerald);
  background: rgba(47, 158, 119, 0.08);
}

/* Compact Month Calendar with Date Cards (SMTUWTFS) */
.month-compact-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  user-select: none;
}

.month-weekdays-bar {
  display: grid;
  grid-template-columns: 38px repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.m-wk-label {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 0;
  border-radius: 4px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Distinct color for day (SMTUWTFS) and week header */
.m-wk-label.wk { color: #6366f1; background: rgba(99, 102, 241, 0.08); }
.m-wk-label.sun { color: #e11d48; background: rgba(225, 29, 72, 0.08); }
.m-wk-label.mon { color: #4f46e5; background: rgba(79, 70, 229, 0.08); }
.m-wk-label.tue { color: #4f46e5; background: rgba(79, 70, 229, 0.08); }
.m-wk-label.wed { color: #4f46e5; background: rgba(79, 70, 229, 0.08); }
.m-wk-label.thu { color: #4f46e5; background: rgba(79, 70, 229, 0.08); }
.m-wk-label.fri { color: #4f46e5; background: rgba(79, 70, 229, 0.08); }
.m-wk-label.sat { color: #0284c7; background: rgba(2, 132, 199, 0.08); }

body.dark-mode .m-wk-label.wk { color: #a5b4fc; background: rgba(99, 102, 241, 0.16); }
body.dark-mode .m-wk-label.sun { color: #fb7185; background: rgba(225, 29, 72, 0.16); }
body.dark-mode .m-wk-label.mon,
body.dark-mode .m-wk-label.tue,
body.dark-mode .m-wk-label.wed,
body.dark-mode .m-wk-label.thu,
body.dark-mode .m-wk-label.fri { color: #818cf8; background: rgba(79, 70, 229, 0.16); }
body.dark-mode .m-wk-label.sat { color: #38bdf8; background: rgba(2, 132, 199, 0.16); }

.month-cards-grid {
  display: grid;
  grid-template-columns: 38px repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.month-week-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  height: 33px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s ease;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.05);
  padding: 0;
  user-select: none;
  font-family: var(--font-mono);
  outline: none;
}

.month-week-btn:hover {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.14);
  color: #3730a3;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(79, 70, 229, 0.15);
}

.month-week-btn:active {
  transform: translateY(0);
}

body.dark-mode .month-week-btn {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #a5b4fc;
}

body.dark-mode .month-week-btn:hover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

.month-week-btn.is-current-week {
  border-color: #2f9e77;
  background: rgba(47, 158, 119, 0.09);
  color: #1f7a5a;
  box-shadow: 0 0 0 1px rgba(47, 158, 119, 0.22);
}

.month-week-btn.is-current-week:hover {
  background: rgba(47, 158, 119, 0.18);
  border-color: #1f7a5a;
  color: #134e3a;
  box-shadow: 0 2px 5px rgba(47, 158, 119, 0.2);
}

body.dark-mode .month-week-btn.is-current-week {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}

body.dark-mode .month-week-btn.is-current-week:hover {
  background: rgba(52, 211, 153, 0.25);
  color: #a7f3d0;
}

.month-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 5px;
  min-height: 38px;
  height: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.12s ease;
  overflow: hidden;
}

.month-day-card:hover {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.04);
}

body.dark-mode .month-day-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.month-day-card.is-today {
  border-color: #2f9e77;
  background: rgba(47, 158, 119, 0.09);
  box-shadow: 0 0 0 1px rgba(47, 158, 119, 0.22);
}

.month-day-card.other-month {
  opacity: 0.38;
  background: rgba(0, 0, 0, 0.015);
}

body.dark-mode .month-day-card.other-month {
  background: rgba(255, 255, 255, 0.02);
}

.month-day-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1;
}

.month-day-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
}

.month-day-today-tag {
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 700;
  background: rgba(47, 158, 119, 0.18);
  color: #1f7a5a;
  padding: 0 3px;
  border-radius: 3px;
  line-height: 1.2;
}

.month-day-summary {
  font-size: 0.61rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.month-day-summary.has-act {
  color: #1f7a5a;
  font-weight: 600;
}

.year-months-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.year-month-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
}

.year-month-card.active-month {
  border-color: var(--accent-emerald);
  background: rgba(47, 158, 119, 0.08);
}

/* ==========================================================================
   Workout Badges Protocol (Z2, N4x4, SIT, 4x4, 3x12, Hike, Mobility)
   Surrounded by Distinct Green Circles
   ========================================================================== */

/* 1. Base Workout Badge with Green Circle Around */
.workout-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  padding: 1px 7px;
  border: 1.5px solid #22c55e; /* Crisp green circle border */
  border-radius: 9999px;      /* Circular pill contour */
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  font-family: var(--font-mono, "SF Mono", monospace);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.22);
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}

/* Inner Green Circle Ring Indicator */
.workout-badge .workout-circle-ring {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid #22c55e;
  background: #22c55e;
  flex-shrink: 0;
  box-sizing: border-box;
}

.workout-badge:hover {
  background: rgba(34, 197, 94, 0.22);
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.38);
  transform: translateY(-0.5px);
}

body.dark-mode .workout-badge {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.20);
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.25);
}

body.dark-mode .workout-badge:hover {
  background: rgba(34, 197, 94, 0.32);
  border-color: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.40);
}

/* Compact version for Month Overview & tight task cards */
.workout-badge.compact {
  font-size: 0.58rem;
  padding: 0 4px;
  height: 16px;
  gap: 2px;
  border-width: 1.2px;
  line-height: 1.1;
  box-shadow: 0 0 0 0.5px rgba(34, 197, 94, 0.25);
}

.workout-badge.compact .workout-circle-ring {
  width: 4px;
  height: 4px;
  border-width: 1px;
}

/* Active logged badge on today's planner or active session */
.workout-badge.is-active-day {
  background: rgba(34, 197, 94, 0.25);
  box-shadow: 0 0 0 1.5px #22c55e;
  color: #0f6730;
}

body.dark-mode .workout-badge.is-active-day {
  background: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 1.5px #4ade80;
  color: #86efac;
}

.workout-badge.is-active-pulse .workout-circle-ring {
  animation: workoutRingPulse 1.5s infinite;
}

@keyframes workoutRingPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* 2. Month Overview Layout Integration */
.month-day-top-badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
}

/* 3. Week Overview Layout Integration */
.day-jump-workout-badges {
  display: flex;
  align-items: center;
  gap: 3.5px;
  flex-wrap: wrap;
  margin: 3px 0 2px 0;
  min-height: 18px;
}

/* 4. Day View Topbar Badge Area */
.planner-day-workout-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.planner-day-workout-badges .workout-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  height: 22px;
}

/* 5. Interactive Workout Picker Popover */
.workout-picker-popover {
  position: fixed;
  z-index: 9999;
  width: 270px;
  background: var(--bg-card);
  border: 1.5px solid var(--accent-emerald, #2f9e77);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(47, 158, 119, 0.3);
  padding: 12px;
  box-sizing: border-box;
  animation: popoverFadeIn 0.14s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.workout-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-subtle);
}

.workout-picker-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workout-picker-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.workout-picker-sub {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.workout-picker-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.workout-picker-del-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
}

.workout-picker-del-icon-btn:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  transform: scale(1.08);
}

.workout-picker-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
}

.workout-picker-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subcard);
}

.workout-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workout-picker-option-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 8px;
  background: var(--bg-subcard);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.workout-picker-option-btn .workout-circle-ring {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #22c55e;
  background: #22c55e;
  flex-shrink: 0;
}

.workout-picker-option-btn .picker-btn-type {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.74rem;
  color: #15803d;
  min-width: 48px;
}

body.dark-mode .workout-picker-option-btn .picker-btn-type {
  color: #4ade80;
}

.workout-picker-option-btn .picker-btn-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-picker-option-btn:hover {
  background: rgba(34, 197, 94, 0.12);
  border-color: #22c55e;
  transform: translateX(2px);
}

.workout-picker-option-btn.is-selected {
  background: rgba(34, 197, 94, 0.20);
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
}

.workout-picker-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: stretch;
}

.workout-picker-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 7px;
  background: rgba(239, 68, 68, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
}

.workout-picker-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #dc2626;
}

/* Inactive chips in daily label area */
.workout-badge.is-inactive-chip {
  opacity: 0.55;
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.workout-badge.is-inactive-chip:hover {
  opacity: 1;
  background: rgba(34, 197, 94, 0.10);
  border-style: solid;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}


