/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f0f13;
  --card-bg: #1a1a24;
  --card-hover: #222233;
  --primary: #6c5ce7;
  --secondary: #00cec9;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --text: #f0f0f5;
  --text-secondary: #8888aa;
  --border: #2a2a3a;
  --radius: 12px;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a4a;
}

/* ===== Screens ===== */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

/* ===== Login Screen ===== */
#login-screen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f13 0%, #1a1030 40%, #0f0f13 70%, #0a1520 100%);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

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

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-logo svg {
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 300;
  margin-bottom: 32px;
}

.input-group {
  text-align: left;
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  text-decoration: none;
}

.btn:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: #5a4bd6;
  border-color: #5a4bd6;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

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

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
  padding: 12px 20px;
}

.btn-logout {
  color: var(--text-secondary);
  border-color: transparent;
  background: transparent;
}

.btn-logout:hover {
  color: var(--danger);
  background: rgba(225, 112, 85, 0.1);
}

/* ===== Navbar ===== */
#navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
}

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

.nav-link {
  position: relative;
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { width: 0; opacity: 0; }
  to { width: 20px; opacity: 1; }
}

/* ===== Views ===== */
.view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view.active {
  display: block;
}

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

.view-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.view-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: #3a3a5a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ===== Section Cards ===== */
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

/* ===== Heatmap Grid ===== */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.heatmap-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
  transition: all var(--transition);
}

.heatmap-card:hover {
  border-color: #3a3a5a;
  transform: translateY(-1px);
}

.heatmap-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
  margin-bottom: 4px;
}

.heatmap-count {
  font-size: 1.3rem;
  font-weight: 700;
}

/* ===== Intensity Chart ===== */
.intensity-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intensity-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.intensity-label {
  font-size: 0.85rem;
  font-weight: 500;
  width: 70px;
  text-transform: capitalize;
  flex-shrink: 0;
}

.intensity-bar-bg {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.intensity-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.intensity-bar.low { background: var(--success); }
.intensity-bar.medium { background: var(--warning); }
.intensity-bar.high { background: var(--danger); }

.intensity-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ===== Recent Workouts ===== */
.recent-workouts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workout-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.workout-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(108, 92, 231, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(4px);
}

.workout-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 90px;
  flex-shrink: 0;
}

.workout-type {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 80px;
  flex-shrink: 0;
}

.workout-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.workout-intensity {
  flex-shrink: 0;
}

/* ===== Muscle Tags ===== */
.muscle-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  line-height: 1.4;
}

/* ===== Intensity Dot ===== */
.intensity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.intensity-dot.low { background: var(--success); }
.intensity-dot.medium { background: var(--warning); }
.intensity-dot.high { background: var(--danger); }

/* ===== Calendar ===== */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-month-year {
  font-size: 1.2rem;
  font-weight: 600;
}

.calendar-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.calendar-day {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  min-height: 80px;
  transition: all var(--transition);
  cursor: default;
  position: relative;
}

.calendar-day:hover {
  border-color: #3a3a5a;
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(108, 92, 231, 0.2);
}

.calendar-day.has-workout {
  cursor: pointer;
  border-left: 3px solid var(--success);
}

.calendar-day.has-workout.intensity-medium {
  border-left-color: var(--warning);
}

.calendar-day.has-workout.intensity-high {
  border-left-color: var(--danger);
}

.calendar-day.has-workout:hover {
  background: var(--card-hover);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.calendar-day-number {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.calendar-day.today .calendar-day-number {
  color: var(--primary);
}

.calendar-day.has-workout .calendar-day-number {
  color: var(--text);
}

.calendar-day-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-day-content .intensity-dot {
  width: 7px;
  height: 7px;
  margin-bottom: 4px;
}

.calendar-day-content .muscle-tag {
  font-size: 0.6rem;
  padding: 1px 6px;
}

.no-workouts-msg {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 0.95rem;
}

/* ===== Upload ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 20px;
  background: var(--card-bg);
}

.upload-zone:hover {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.04);
}

.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.08);
  box-shadow: 0 0 30px rgba(108, 92, 231, 0.1);
  transform: scale(1.01);
}

.upload-icon {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.upload-zone.dragover .upload-icon {
  color: var(--primary);
}

.upload-text {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.upload-text strong {
  color: var(--primary);
}

.upload-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upload-status {
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

.upload-status.success {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: var(--success);
}

.upload-status.error {
  background: rgba(225, 112, 85, 0.1);
  border: 1px solid rgba(225, 112, 85, 0.3);
  color: var(--danger);
}

.upload-status.loading {
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.3);
  color: var(--primary);
}

.format-guide {
  margin-top: 12px;
}

.format-example {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.7;
}

.format-example code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--text-secondary);
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.15s ease;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  margin: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-body .workout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-body .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-body .meta-item strong {
  color: var(--text);
  font-weight: 600;
}

.modal-body .exercise-list {
  list-style: none;
}

.modal-body .exercise-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.modal-body .exercise-item:last-child {
  border-bottom: none;
}

.modal-body .exercise-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.modal-body .exercise-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-body .workout-notes {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-body .workout-notes strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ===== Toast Notifications ===== */
#toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.25s ease;
  max-width: 360px;
}

.toast.success {
  background: rgba(0, 184, 148, 0.15);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: var(--success);
}

.toast.error {
  background: rgba(225, 112, 85, 0.15);
  border: 1px solid rgba(225, 112, 85, 0.3);
  color: var(--danger);
}

.toast.info {
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.3);
  color: var(--primary);
}

.toast.removing {
  animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== Loading Spinner ===== */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
  gap: 10px;
  font-size: 0.9rem;
}

.loading-spinner::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== Settings ===== */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.connected {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.status-badge.disconnected {
  background: rgba(136, 136, 170, 0.15);
  color: var(--text-secondary);
}

.status-badge.syncing {
  background: rgba(108, 92, 231, 0.15);
  color: var(--primary);
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.connected-info {
  display: flex;
  gap: 24px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.connected-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.connected-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.connected-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.settings-form {
  margin-bottom: 16px;
}

.settings-form .input-group {
  margin-bottom: 16px;
}

.settings-form .input-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.settings-form .input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.input-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.input-hint a {
  color: var(--primary);
  text-decoration: none;
}

.input-hint a:hover {
  text-decoration: underline;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.test-result {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  animation: fadeIn 0.2s ease;
}

.test-result.success {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: var(--success);
}

.test-result.error {
  background: rgba(225, 112, 85, 0.1);
  border: 1px solid rgba(225, 112, 85, 0.3);
  color: var(--danger);
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
}

.input-hint code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8em;
}

.sync-controls {
  padding-top: 4px;
}

.sync-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.toggle-input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle-input:checked + .toggle-switch {
  background: var(--primary);
}

.toggle-input:checked + .toggle-switch::after {
  left: 21px;
  background: #fff;
}

.sync-status {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  animation: fadeIn 0.2s ease;
}

.sync-status.success {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: var(--success);
}

.sync-status.error {
  background: rgba(225, 112, 85, 0.1);
  border: 1px solid rgba(225, 112, 85, 0.3);
  color: var(--danger);
}

.sync-status.syncing {
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.3);
  color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .heatmap-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  #navbar {
    padding: 0 16px;
    gap: 8px;
  }

  .nav-brand span {
    display: none;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .view-content {
    padding: 20px 16px 40px;
  }

  .calendar-day {
    min-height: 60px;
    padding: 6px;
  }

  .calendar-day-content .muscle-tag {
    display: none;
  }

  .workout-card {
    flex-wrap: wrap;
    gap: 8px;
  }

  .workout-type {
    min-width: auto;
  }

  .modal-card {
    max-height: 90vh;
    margin: 10px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .heatmap-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card {
    padding: 16px;
  }

  .day-header {
    font-size: 0.65rem;
  }

  .calendar-day-number {
    font-size: 0.75rem;
  }

  .login-card {
    padding: 32px 24px;
  }
}
