:root {
  color-scheme: dark;
  /* ChaseTheZones brand theme - darker muted palette */
  /* Backgrounds - darker charcoal and blue-grey panels */
  --bg-primary: #0a0e1a;
  --bg-panel: #1a1f2e;
  --bg-card: #1a1f2e;
  --bg-card-soft: rgba(26, 31, 46, 0.95);
  /* Text colors - light text on dark backgrounds */
  --text-primary: #ffffff;
  --text-muted: #a0a8b8;
  --text-secondary: #6b7280;
  /* Brand accent colors - more muted */
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-teal: #14b8a6;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;
  --accent-purple: #8b5cf6;
  /* Borders and shadows */
  --border-subtle: rgba(160, 168, 184, 0.15);
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.5);
  /* Additional utility colors */
  --bg-subtle: #1a1f2e;
  --bg-accent: #252b3a;
  --color-primary: #3b82f6;
  --color-primary-rgb: 59, 130, 246;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /* Darker muted background with subtle purple-blue gradient */
  background: #0a0e1a;
  background-image: linear-gradient(135deg, rgba(26, 31, 46, 0.6), rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  background-attachment: fixed;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
}


.site-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.site-nav-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.site-header {
  position: relative;
  z-index: 1000;
  /* Darker muted header */
  background: rgba(26, 31, 46, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px clamp(16px, 4vw, 48px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  overflow: visible;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.25rem;
}

.site-header__tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.site-header__logo {
  height: auto;
  max-height: 60px;
  width: auto;
  display: block;
}

.site-header__logo--nav {
  max-height: 80px;
}

/* Mobile: Hide nav logo, show bar logo */
.site-header__brand--nav {
  display: none;
}

.site-header__actions--nav {
  display: none;
}

@media (max-width: 1023px) {
  .site-header__brand--nav {
    display: none !important;
  }
  
  .site-header__logo--nav {
    display: none !important;
  }
  
  .site-header__brand {
    display: inline-flex;
  }

  .site-header__actions--nav {
    display: none !important;
  }
  
  .site-header__actions--mobile {
    display: flex;
  }
}

.site-header__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header__toggle:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}

.site-header__toggle-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.site-nav-open .site-header__toggle-line:nth-child(2) {
  opacity: 0;
}

body.site-nav-open .site-header__toggle-line:first-child {
  transform: translateY(7px) rotate(45deg);
}

body.site-nav-open .site-header__toggle-line:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-header__actions--desktop {
  display: none;
}

.site-header__actions--nav {
  display: none;
}

.site-header__actions--mobile {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.site-header__greeting {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-header__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.site-header__link:hover {
  color: var(--text-primary);
}

.site-header__cta {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-header__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.site-header__logout {
  margin: 0;
}

/* Sync Status in Navigation */
.sync-status-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.sync-status-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sync-button-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sync-button-nav:hover {
  background: var(--bg-accent);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.sync-button-nav svg {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.8;
}

.sync-status-nav--mobile {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

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

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.is-open .modal-content {
  transform: scale(1);
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-panel);
  color: var(--text-primary);
}

.modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.sync-form {
  margin-bottom: 1rem;
}

/* Connected Accounts Section */
.connected-accounts-section {
  margin-top: 1.5rem;
}

.connected-accounts-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.account-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.account-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.account-details p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.account-actions .sync-form,
.account-actions .disconnect-form {
  margin: 0;
}

.sync-action-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.sync-action-group form {
  width: 100%;
}

.sync-action-group .sync-button {
  width: 100%;
  justify-content: center;
}

.button-help {
  margin: 0;
  text-align: right;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 100%;
}

.button-help a {
  text-decoration: none;
  font-weight: 500;
}

.button-help a:hover {
  text-decoration: underline;
}

/* Mobile Responsive Styles for Modal */
@media (max-width: 640px) {
  .modal {
    padding: 0.5rem;
  }

  .modal-content {
    max-width: 100%;
    width: 100%;
    margin: 0;
    max-height: 95vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-header h2 {
    font-size: 1.1rem;
    flex: 1;
    min-width: 0;
  }

  .modal-close {
    flex-shrink: 0;
    padding: 0.375rem;
  }

  .modal-close svg {
    width: 1rem;
    height: 1rem;
  }

  .modal-body {
    padding: 1rem;
    overflow-y: auto;
  }

  .modal-body p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
  }

  .account-row {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    align-items: stretch;
  }

  .account-info {
    width: 100%;
  }

  .account-info h4 {
    font-size: 0.95rem;
  }

  .account-details p {
    font-size: 0.8rem;
  }

  .account-actions {
    width: 100%;
    align-items: stretch;
    gap: 0.75rem;
  }

  .sync-action-group {
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .sync-action-group .sync-button,
  .sync-action-group .button-primary,
  .sync-action-group .button-secondary {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 44px; /* Better touch target */
    justify-content: center;
  }

  .button-help {
    text-align: left;
    max-width: 100%;
    font-size: 0.8rem;
    padding: 0.25rem 0;
  }

  .button-help br {
    display: block;
    margin: 0.25rem 0;
  }

  .disconnect-button {
    width: 100%;
    padding: 0.75rem 1rem;
    min-height: 44px; /* Better touch target */
    font-size: 0.9rem;
  }

  .connected-accounts-section {
    margin-top: 1rem;
  }

  .connected-accounts-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .add-account-section {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .add-account-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .no-accounts {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}

/* Button Styles */
.button-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.button-secondary:hover {
  background: var(--bg-accent);
  border-color: var(--accent-blue);
}

.button-secondary svg {
  width: 0.9rem;
  height: 0.9rem;
}

.button-danger {
  background: #dc3545;
  color: white;
  border: 1px solid #dc3545;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.button-danger:hover {
  background: #c82333;
  border-color: #bd2130;
}

/* Add Account Section */
.add-account-section {
  margin-top: 1.5rem;
}

.add-account-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sync-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.sync-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

.sync-submit-btn svg {
  width: 1rem;
  height: 1rem;
}

.no-accounts {
  text-align: center;
  color: var(--text-muted);
}

.no-accounts a {
  color: var(--accent-blue);
  text-decoration: none;
}

.no-accounts a:hover {
  text-decoration: underline;
}

body.modal-open {
  overflow: hidden;
}

.site-header__nav {
  display: none;
  flex-direction: column;
  gap: 20px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  overflow: visible;
  position: relative;
}

.site-header__nav.is-open {
  display: flex;
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: visible;
}

.site-nav__link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-nav__link:hover {
  color: var(--accent-blue);
  border-bottom-color: rgba(50, 174, 241, 0.35);
}

.site-nav__link[data-placeholder="true"] {
  color: var(--text-muted);
  cursor: not-allowed;
  border-bottom-color: transparent;
}

.site-nav__link[data-placeholder="true"]::after {
  content: "Soon";
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-muted);
}

.page-shell {
  flex: 1;
  padding: clamp(28px, 6vw, 64px) clamp(20px, 6vw, 80px) 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav__item {
  position: relative;
}

.site-nav__item--has-dropdown {
  position: relative;
}

.site-nav__link--dropdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.site-nav__arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.site-nav__item--has-dropdown[data-dropdown-open] .site-nav__arrow,
.site-nav__item--has-dropdown:hover .site-nav__arrow,
.site-nav__item--has-dropdown:focus-within .site-nav__arrow {
  transform: rotate(180deg);
}

.site-nav__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bg-panel, #282c34);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  list-style: none;
  margin: -0.25rem 0 0;
  padding: 0.75rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1100;
  pointer-events: none;
}

.site-nav__item--has-dropdown:hover .site-nav__dropdown,
.site-nav__item--has-dropdown[data-dropdown-open] .site-nav__dropdown,
.site-nav__item--has-dropdown:focus-within .site-nav__dropdown,
.site-nav__dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.site-nav__dropdown-link {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--text-primary, #ffffff);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 0.9375rem;
}

.site-nav__dropdown-link:hover,
.site-nav__dropdown-link:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #ffffff);
  outline: none;
}

.site-nav__link--admin {
  color: rgba(255, 215, 0, 0.9);
  font-weight: 500;
  position: relative;
}

.site-nav__link--admin::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: rgba(255, 215, 0, 0.5);
  border-radius: 2px;
}

.site-nav__dropdown--admin {
  border-color: rgba(255, 215, 0, 0.2);
}

.site-nav__dropdown--admin .site-nav__dropdown-link {
  color: rgba(255, 255, 255, 0.9);
}

.site-nav__dropdown--admin .site-nav__dropdown-link:hover,
.site-nav__dropdown--admin .site-nav__dropdown-link:focus {
  background-color: rgba(255, 215, 0, 0.15);
  color: rgba(255, 215, 0, 0.95);
}

@media (max-width: 1023px) {
  .site-header__nav {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav__item--has-dropdown {
    width: 100%;
  }

  .site-nav__link--dropdown {
    width: 100%;
    cursor: pointer;
  }

  .site-nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    margin: 0;
    padding: 0.5rem 0 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding-left: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: auto;
  }

  .site-nav__item--has-dropdown[data-dropdown-open] .site-nav__dropdown {
    display: block;
  }

  .site-nav__item--has-dropdown:hover .site-nav__dropdown {
    display: none;
  }

  .site-nav__dropdown-link {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 640px) {
  .site-header__nav {
    gap: 24px;
  }

  .page-shell {
    padding: 24px 18px 64px;
  }
}

@media (min-width: 1024px) {
  .site-header {
    padding: 14px clamp(24px, 4vw, 64px);
  }

  .site-header__toggle {
    display: none;
  }

  .site-header__nav {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    overflow: visible;
  }

  .site-nav {
    flex-direction: row;
    gap: 24px;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    overflow: visible;
  }

  .site-header__brand--nav {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
  }

  .site-header__logo--nav {
    max-height: 80px;
  }

  .site-nav__dropdown {
    display: block;
  }

  .site-nav__link {
    padding: 6px 0;
  }

  .site-header__bar .site-header__brand {
    display: none;
  }

  .site-header__actions--nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
  }

  .site-header__actions--desktop {
    display: flex;
  }

  .site-header__actions--mobile {
    display: none;
  }
  
  .site-header__nav .site-header__actions--mobile {
    display: none !important;
  }
  
  /* Ensure click-opened dropdowns work alongside hover on desktop */
  .site-nav__item--has-dropdown[data-dropdown-open] .site-nav__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Tablet landscape and touch device support */
@media (hover: none) and (pointer: coarse) {
  /* On touch devices, disable hover-based dropdowns */
  .site-nav__item--has-dropdown:hover .site-nav__dropdown {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* On touch devices, only show dropdowns when opened via click */
  .site-nav__item--has-dropdown[data-dropdown-open] .site-nav__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  
  /* Ensure dropdowns are clickable on touch devices */
  .site-nav__link--dropdown {
    cursor: pointer;
  }
  
  /* Make dropdown links easier to tap on touch devices */
  .site-nav__dropdown-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Tablet landscape specific styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .site-header {
    padding: 12px clamp(20px, 3.5vw, 48px);
  }
  
  .site-nav {
    gap: 16px;
  }
  
  .site-nav__link {
    font-size: 0.9rem;
    padding: 8px 0;
  }
  
  /* Ensure dropdowns work on tablets */
  .site-nav__dropdown {
    min-width: 180px;
  }
  
  /* Make dropdown links easier to tap */
  .site-nav__dropdown-link {
    padding: 0.875rem 1rem;
    min-height: 44px;
  }
}
.page-shell {
  padding: 40px clamp(24px, 6vw, 80px) 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  letter-spacing: -0.01em;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.filter-chip.active,
.filter-chip:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
}

.integration-shell {
  margin: 32px 0;
}

.integration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

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

.integration-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.integration-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.integration-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}

.account-row h3 {
  margin: 0;
  font-size: 1rem;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.account-actions form {
  margin: 0;
  display: flex;
  justify-content: flex-end;
}

.account-actions .sync-button {
  width: 100%;
}

@media (min-width: 640px) {
  .account-actions {
    align-items: flex-end;
  }
  .account-actions .sync-button {
    width: auto;
  }
}


.sync-form {
  display: flex;
  align-items: center;
}

/* Reconnect Form Styling */
.reconnect-action-group {
  width: 100%;
  min-width: 280px;
}

.reconnect-help {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.75rem;
  background: var(--bg-accent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  border-left: 3px solid #f59e0b;
}

.reconnect-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.reconnect-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reconnect-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.reconnect-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.reconnect-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.reconnect-input::placeholder {
  color: var(--text-muted);
}

.reconnect-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  font-size: 0.95rem;
  gap: 0.5rem;
}

.reconnect-button svg {
  animation: rotate 2s linear infinite;
}

.reconnect-button:hover svg {
  animation: rotate 1s linear infinite;
}

/* Account row layout improvements */
.account-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.25rem;
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  min-width: 280px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .account-actions {
    min-width: 320px;
  }
}

/* Disconnect button alignment */
.disconnect-form {
  margin-top: 0.5rem;
}

.disconnect-button {
  width: 100%;
  justify-content: center;
}

@media (min-width: 640px) {
  .account-actions {
    align-items: flex-end;
  }
  
  .disconnect-button {
    width: auto;
    min-width: 120px;
  }
  
  .reconnect-action-group {
    min-width: 320px;
  }
}

.integration-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.integration-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.button-secondary:hover {
  border-color: var(--accent-blue);
  background: var(--bg-accent);
}

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

.integration-form .form-help {
  font-size: 0.8rem;
  margin: 0;
}

.form-errors {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.85rem;
  color: #dc2626;
}

.form-errors p {
  margin: 0;
}

.message-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.9rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #d97706;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #2563eb;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.summary-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.summary-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
  font-weight: 600;
}

/* Workout card styles moved to templates/workouts/list.html for page-specific styling */
/* .card-grid, .workout-card, .workout-card-header styles are now defined inline in the template */

.workout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.metric-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metric-badge {
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.zone-strip {
  height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border-subtle);
}

.zone-segment {
  height: 100%;
  position: relative;
}

.zone-segment span {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-footer a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.detail-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.detail-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.detail-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.panel {
  /* ChaseTheHare card style - clean white panels with subtle shadows */
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-medium);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.metrics-table {
  width: 100%;
  border-spacing: 0;
}

.metrics-table th,
.metrics-table td {
  text-align: left;
  padding: 8px 0;
  font-size: 0.9rem;
}

.metrics-table tbody tr + tr td {
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
  .nav-shell {
    padding: 16px 20px;
  }
  .page-shell {
    padding: 32px 20px 72px;
  }
}

.text-muted {
  color: var(--text-muted);
}

.auth-shell {
  max-width: 420px;
  margin: 80px auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-card {
  /* ChaseTheHare auth card - white card with shadow */
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-medium);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.75rem;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-field input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
}

.form-field input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-errors,
.field-errors {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  color: #dc2626;
  font-size: 0.85rem;
}

.form-errors p,
.field-errors p {
  margin: 0;
}

.form-help-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.button-primary {
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .auth-shell {
    margin: 40px auto;
    padding: 0 16px;
  }

  .auth-card {
    padding: 24px;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-greeting {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
  background: var(--bg-panel);
}

.nav-link.nav-cta {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.nav-link.nav-cta:hover {
  transform: translateY(-1px);
}

.nav-button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.nav-button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.nav-logout {
  margin: 0;
}

.nav-logout button {
  border-radius: 999px;
}



.class-plan-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.class-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.class-plan-total {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.class-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.class-plan-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-plan-item-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.class-plan-item-name {
  font-weight: 600;
}

.class-plan-item-duration {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.class-plan-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pace-plan-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.pace-plan-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pace-target-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pace-target-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pace-target-header h3 {
  margin-bottom: 4px;
}

.pace-target-bounds {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}

.pace-target-chart {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 18px 90px 40px 18px;
  overflow: hidden;
}

.pace-plan-row {
  position: relative;
  padding: 10px 14px 18px;
  border-radius: var(--radius-md);
}

.pace-plan-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--zone-color);
  opacity: 0.22;
  border-radius: inherit;
}

.pace-plan-row-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pace-plan-row-label {
  color: var(--text-primary);
}

.pace-plan-row-range {
  color: var(--text-muted);
}

.pace-plan-row-track {
  position: relative;
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
  z-index: 1;
}

.pace-plan-block {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: var(--zone-color);
  opacity: 0.82;
}

.pace-chart-bands {
  position: absolute;
  left: 18px;
  right: 70px;
  top: 18px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.pace-chart-band {
  flex: 1 1 auto;
  opacity: 0.18;
  mix-blend-mode: screen;
}

.pace-chart-labels {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

.pace-chart-labels span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pace-chart-labels strong {
  color: var(--text-primary);
}

.pace-chart-labels em {
  font-style: normal;
  font-size: 0.65rem;
  color: var(--text-secondary);
}


.pace-target-svg {
  position: absolute;
  left: 18px;
  right: 72px;
  top: 18px;
  bottom: 40px;
  pointer-events: none;
  z-index: 3;
}

.pace-target-stats {
  position: absolute;
  bottom: 52px;
  left: 26px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 4;
}

.pace-target-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pace-target-stats span {
  color: var(--text-muted);
}

.pace-target-stats strong {
  font-size: 0.96rem;
  color: var(--text-primary);
  letter-spacing: 0;
}

.pace-target-path {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-width: 2.4;
  opacity: 0.95;
}

.pace-target-path.pace-target-plan {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-dasharray: 6 4;
  stroke-width: 1.35;
}

.pace-target-path.pace-target-actual {
  stroke: #5b7cfa;
  stroke-width: 3.2;
  filter: drop-shadow(0 8px 18px rgba(91, 124, 250, 0.35));
}

.pace-target-axis {
  position: absolute;
  left: 18px;
  right: 72px;
  bottom: 10px;
  height: 18px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pace-target-tick {
  position: absolute;
  transform: translateX(-50%);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pace-target-tick::before {
  content: "";
  display: block;
  height: 8px;
  width: 1px;
  margin: 0 auto 6px;
  background: var(--border-subtle);
}

/* Pace chart legend and readout */
.pace-chart-legend {
  margin: 10px 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pace-chart-legend .zitem {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}

.pace-chart-legend .zitem i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.pace-chart-readout {
  margin: 6px 12px 0;
  opacity: 0.85;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.pace-target-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-swatch.plan {
  background: transparent;
  border: 1px dashed var(--text-muted);
}

.legend-swatch.actual {
  background: #4c6ef5;
  box-shadow: 0 0 8px rgba(76, 110, 245, 0.4);
}

.metrics-panel .metric-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-summary li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.metric-summary li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.metric-summary span {
  color: var(--text-muted);
}

.metric-summary strong {
  font-size: 1.05rem;
}

.pace-reference-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pace-reference-panel li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.pace-reference-label {
  font-weight: 600;
  font-size: 0.85rem;
}

.pace-reference-value {
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .class-plan-list {
    grid-template-columns: 1fr;
  }
  .pace-target-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .pace-target-bounds {
    align-self: flex-start;
  }
  .pace-target-chart {
    padding: 16px 16px 52px;
  }
  .pace-target-stats {
    position: static;
    margin-bottom: 12px;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  .pace-target-stats div {
    flex: 1 1 auto;
  }
}

/* Layout: put plan + chart side-by-side on desktop */
.pace-target-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr minmax(200px, 280px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1200px) {
  .pace-target-grid { grid-template-columns: minmax(280px, 360px) 1fr; }
  .pace-zone-legend { display: none; }
}
@media (max-width: 980px) {
  .pace-target-grid { grid-template-columns: 1fr; }
}

/* Give the chart real height + consistent padding variables */
.pace-target-chart {
  --pad-l: 18px;
  --pad-r: 18px;  /* reduced since legend is now separate */
  --pad-t: 18px;
  --pad-b: 48px;  /* space for bottom axis */
  height: clamp(320px, 46vh, 600px);
  padding: var(--pad-t) var(--pad-r) var(--pad-b) var(--pad-l);
}

/* Position internals using the same paddings so they scale cleanly */
.pace-chart-bands,
.pace-target-svg {
  position: absolute;
  left: var(--pad-l);
  right: var(--pad-r);
  top: var(--pad-t);
  bottom: var(--pad-b);
}

/* Make bands distribute evenly by number of layers (was flex) */
.pace-chart-bands {
  display: grid;
  grid-template-rows: repeat(var(--layer-count, 1), 1fr);
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0.18;
}

/* Labels & axis align to same paddings */
.pace-chart-labels {
  top: var(--pad-t);
  right: 18px;   /* independent from --pad-r for readability */
  bottom: var(--pad-b);
}
.pace-target-axis {
  left: var(--pad-l);
  right: var(--pad-r);
  bottom: 12px;
}

/* Make plan timeline beefier for readability */
.pace-plan-rows { gap: 14px; }
.pace-plan-row-track { height: 14px; }

/* Slightly stronger line presence */
.pace-target-path.pace-target-actual { stroke-width: 3.2; }
.pace-target-path.pace-target-plan  { stroke-width: 2; stroke-dasharray: 4 4; }

/* Pace Zone Legend */
.pace-zone-legend {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.pace-zone-legend h4 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.pace-zone-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Muscle Chart Styles */
.muscle-chart {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 20px;
  max-width: 100%;
}

.muscle-figures {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  justify-content: center;
}

.muscle-figure {
  width: 100px;
  height: 200px;
  position: relative;
}

.muscle-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.muscle-groups .muscle-group {
  transition: fill 0.3s ease;
  cursor: pointer;
}

.muscle-groups .muscle-group:hover {
  fill: rgba(0, 123, 255, 0.1);
}

.muscle-groups .muscle-group.muscle-group--active {
  fill: var(--muscle-color-active);
}

/* Muscle data list */
.muscle-data {
  min-width: 0;
  max-width: 400px;
}

/* Muscle legend */
.muscle-legend {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-panel);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.legend-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
}

.legend-color--primary {
  background: #ff4444;
}

.legend-color--secondary {
  background: #ffaa00;
}

.legend-color--untargeted {
  background: #666666;
}

/* Read-only workout table styles */
.workout-table input:disabled,
.workout-table select:disabled {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
  cursor: default !important;
  opacity: 1 !important;
}

.workout-table input:disabled:focus,
.workout-table select:disabled:focus {
  outline: none !important;
  box-shadow: none !important;
}

.edit-only {
  display: none;
}

.workout-table.edit-mode .edit-only {
  display: table-cell;
}

.workout-table.edit-mode input:disabled,
.workout-table.edit-mode select:disabled {
  background: var(--input-bg) !important;
  border: 1px solid var(--border-color) !important;
  cursor: text !important;
}

/* Two-column workout layout */
.workout-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.workout-left-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.workout-right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Responsive design for two-column layout */
@media (max-width: 1024px) {
  .workout-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .workout-left-column,
  .workout-right-column {
    gap: 16px;
  }
}

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

.muscle-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 4px;
  padding: 8px 12px;
}

.muscle-item:hover {
  background-color: var(--bg-subtle);
}

.muscle-item.muscle-item--active {
  background-color: var(--bg-accent);
}

.muscle-name {
  font-weight: 500;
  color: var(--text-primary);
  min-width: 80px;
  font-size: 0.9rem;
}

.muscle-percentage {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
  font-size: 0.9rem;
}

.muscle-bar {
  flex: 1;
  height: 8px;
  background-color: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.muscle-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.muscle-bar-fill--bucket-1 {
  background-color: var(--muscle-color-1);
}

.muscle-bar-fill--bucket-2 {
  background-color: var(--muscle-color-2);
}

.muscle-bar-fill--bucket-3 {
  background-color: var(--muscle-color-3);
}

/* Muscle color variables based on bucket levels */
:root {
  --muscle-color-1: #dbeafe; /* Light blue for low activity */
  --muscle-color-2: #93c5fd; /* Medium blue for medium activity */
  --muscle-color-3: #3b82f6; /* Dark blue for high activity */
  --muscle-color-active: #2563eb; /* Active/hover state */
}

/* Responsive design */
@media (max-width: 768px) {
  .muscle-chart {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .muscle-figures {
    justify-content: center;
  }
  
  .muscle-figure {
    width: 80px;
    height: 200px;
  }
  
  .muscle-item {
    gap: 12px;
  }
  
  .muscle-name {
    min-width: 70px;
    font-size: 0.85rem;
  }
  
  .muscle-percentage {
    min-width: 35px;
    font-size: 0.85rem;
  }
}

.pace-zone-color-bar {
  width: 4px;
  height: 24px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pace-zone-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.pace-zone-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pace-zone-range {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Workout Tracking Styles */
.workout-tracking {
  margin-top: 20px;
}

.class-movements-info {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.class-movements-info h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.class-movements-info p {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.class-movements-info .btn {
  font-size: 0.9rem;
  padding: 8px 16px;
}

.workout-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.workout-summary {
  display: flex;
  gap: 24px;
  margin-left: auto;
  flex-wrap: wrap;
}

.summary-item {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.workout-table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.workout-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 0.9rem;
}

.workout-table th {
  background: var(--bg-subtle);
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.workout-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.workout-set-row:nth-child(even) {
  background: var(--bg-subtle);
}

.workout-set-row:hover {
  background: var(--bg-accent);
}

.set-number {
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  min-width: 40px;
}

.exercise-select,
.custom-exercise,
.time-input,
.rest-input,
.reps-input,
.weight-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.exercise-select:focus,
.custom-exercise:focus,
.time-input:focus,
.rest-input:focus,
.reps-input:focus,
.weight-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

.custom-exercise {
  margin-top: 4px;
}

.muscle-groups-hint,
.skill-level-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

.muscle-groups-hint {
  color: var(--color-primary);
}

.skill-level-hint {
  color: var(--text-secondary);
}

.volume-cell {
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  min-width: 80px;
}

.volume-display {
  color: var(--color-primary);
}

.remove-set-btn {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Responsive design for workout table */
@media (max-width: 768px) {
  .workout-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .workout-summary {
    margin-left: 0;
    justify-content: space-between;
  }
  
  .workout-table th,
  .workout-table td {
    padding: 6px 4px;
    font-size: 0.8rem;
  }
  
  .exercise-select,
  .custom-exercise,
  .time-input,
  .rest-input,
  .reps-input,
  .weight-input {
    font-size: 0.8rem;
    padding: 4px 6px;
  }
  
  .set-number {
    min-width: 30px;
  }
  
  .volume-cell {
    min-width: 60px;
  }
}

@media (max-width: 480px) {
  .workout-table th:nth-child(3),
  .workout-table th:nth-child(4),
  .workout-table td:nth-child(3),
  .workout-table td:nth-child(4) {
    display: none;
  }
}

/* Song Library Styles */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.analytics-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.analytics-item a {
  color: var(--accent-blue);
  text-decoration: none;
}

.analytics-item a:hover {
  text-decoration: underline;
}

.usage-count, .song-count, .genre-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.genre-tag {
  display: inline-block;
  background: var(--bg-card-soft);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
}

.class-genres {
  margin-bottom: 1rem;
}

.class-album {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.class-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.explicit {
  background: #dc3545;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.popularity {
  color: var(--text-muted);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.instructor-name, .discipline-name {
  color: var(--text-primary);
  font-weight: 500;
}

.music-icon {
  font-size: 3rem;
  color: var(--text-muted);
}

.class-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg-card-soft);
}

.class-icon {
  font-size: 2rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.empty-state p {
  margin: 0;
}

/* ===== Metrics Dashboard Styles ===== */
.metrics-dashboard {
  padding: 2rem;
  width: 100vw;
  min-height: 100vh;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

.filter-bar {
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-medium);
}

.filter-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  background: var(--bg-panel);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.filter-tab:hover {
  background: var(--bg-accent);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.filter-tab--active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-soft);
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.dashboard-header .subtitle {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-muted);
}

/* Header Content Layout */
.dashboard-header .header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.dashboard-header .header-text {
  text-align: center;
}

.dashboard-header .header-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.dashboard-header .header-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

/* Mobile Sync Button - Only visible on mobile */
.mobile-sync-button-container {
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
}

.mobile-sync-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.mobile-sync-button:hover:not(:disabled) {
  background: var(--accent-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.mobile-sync-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mobile-sync-button svg {
  width: 1.1rem;
  height: 1.1rem;
  animation: rotate 2s linear infinite;
}

.mobile-sync-button.is-loading svg {
  animation: rotate 1s linear infinite;
}

/* Desktop Sync Button - Only visible on desktop */
.desktop-sync-button-container {
  display: none;
}

.sync-button-desktop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.sync-button-desktop:hover:not(:disabled) {
  background: var(--accent-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.sync-button-desktop:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sync-button-desktop svg {
  width: 1rem;
  height: 1rem;
}

.sync-button-desktop.is-loading svg {
  animation: rotate 1s linear infinite;
}

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

/* Desktop: Show desktop button, hide mobile button */
@media (min-width: 768px) {
  .dashboard-header .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
  }

  .dashboard-header .header-text {
    text-align: left;
    flex: 1;
  }

  .dashboard-header .header-actions {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }

  .mobile-sync-button-container {
    display: none;
  }

  .desktop-sync-button-container {
    display: block;
  }
}

.dashboard-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

/* Compact analytics section */
.dashboard-section:has(.analytics-grid) {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.dashboard-section:has(.analytics-grid) .section-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

.dashboard-section:has(.analytics-grid) .section-header h2 {
  font-size: 1.25rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.total-points {
  background: var(--accent-blue);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.achievement-badge {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
}

.achievement-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-blue);
}

.badge-icon {
  font-size: 2rem;
  opacity: 0.8;
}

.badge-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-content p {
  margin: 0 0 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.points {
  background: var(--accent-green);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.no-achievements {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.zone-time-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
}

.panel-header h3 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.zone-charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.zone-time-panel-compact {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
}

.zone-time-panel-compact .panel-header {
  margin-bottom: 1rem;
  text-align: center;
}

.zone-time-panel-compact .panel-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.zone-time-panel-compact .panel-header .total-time {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.zone-chart-container {
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
  height: 220px;
  min-height: 220px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-chart-container canvas {
  max-width: 100%;
  max-height: 100%;
}

.zone-legend-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  font-size: 0.8rem;
}

.zone-legend-compact .zone-item {
  padding: 0.4rem;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zone-legend-compact .zone-label {
  font-size: 0.75rem;
  flex: 1;
}

.zone-legend-compact .zone-time {
  font-size: 0.7rem;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .zone-charts-row {
    grid-template-columns: 1fr;
  }
}

.zone-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.zone-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.zone-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zone-1 .zone-color { background: #3b82f6; }
.zone-2 .zone-color { background: #10b981; }
.zone-3 .zone-color { background: #f59e0b; }
.zone-4 .zone-color { background: #f97316; }
.zone-5 .zone-color { background: #ef4444; }
.zone-6 .zone-color { background: #8b5cf6; }
.zone-7 .zone-color { background: #ec4899; }

.zone-label {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.zone-time {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.no-zone-data {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.no-zone-data ul {
  text-align: left;
  display: inline-block;
  margin: 1rem 0;
}

/* KPI Widgets */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.kpi-widget {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.kpi-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi-widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--accent-blue);
}

.kpi-widget:hover::before {
  opacity: 1;
}

.kpi-header {
  margin-bottom: 1rem;
}

.kpi-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-comparison {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.kpi-comparison.kpi-positive {
  color: #10b981;
}

.kpi-comparison.kpi-negative {
  color: #ef4444;
}

.kpi-arrow {
  font-size: 1rem;
}

.kpi-change {
  font-weight: 700;
}

.kpi-period {
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-percent {
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.5rem;
}

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

.ftp-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
}

.ftp-chart-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.ftp-chart-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ftp-chart-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ftp-chart-container canvas {
  max-height: 400px;
}

@media (max-width: 768px) {
  .ftp-charts {
    grid-template-columns: 1fr;
  }
  
  .ftp-chart-container {
    padding: 1rem;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-blue);
}

.stat-card h3 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--accent-blue);
}

.stat-card p {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Library Pages Full-Width Layout ===== */
.main-content {
  width: 100vw;
  min-height: 100vh;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: 2rem;
}

/* ===== Song Library Styles ===== */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.song-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}

.song-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-blue);
}

.song-image-container {
  width: 100%;
  height: 200px;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-panel);
}

.song-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  color: var(--text-muted);
}

.music-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.song-content {
  color: var(--text-primary);
}

.song-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.song-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.song-title a:hover {
  color: var(--accent-blue);
}

.song-artists {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.song-album {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.song-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.genre-tag {
  background: var(--accent-blue);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.song-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.analytics-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  box-shadow: var(--shadow-soft);
}

.panel-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.analytics-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.analytics-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}

.song-link, .class-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.song-link:hover, .class-link:hover {
  color: var(--accent-blue);
}

.usage-count, .genre-count, .song-count {
  background: var(--accent-blue);
  color: white !important;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.genre-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* Analytics Toggle */
.analytics-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-subtle);
  transition: 0.2s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

.toggle-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}
