/* CSS Custom Properties */
:root {
  /* Color Palette - Deep ocean theme */
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-card: #1a2332;
  --bg-card-hover: #243044;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #06b6d4;
  --accent-secondary: #0891b2;
  --accent-glow: rgba(6, 182, 212, 0.3);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-accent: rgba(6, 182, 212, 0.3);
  
  /* Typography */
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ==================== */
/* LOGIN SCREEN         */
/* ==================== */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity var(--transition-normal);
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 360px;
}

.login-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
}

.login-title {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.login-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  text-align: center;
  letter-spacing: 0.15em;
  outline: none;
  transition: border-color var(--transition-fast);
}

.login-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

.login-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-btn {
  width: 100%;
  padding: var(--space-md);
  background: var(--accent-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast);
}

.login-btn:hover {
  background: var(--accent-secondary);
}

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

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  font-family: var(--font-primary);
}

.login-error.hidden {
  display: none;
}

/* Logout button in nav */
.top-nav-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
  margin-left: auto;
}

.top-nav-logout:hover {
  color: var(--text-primary);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-gutter: stable;
}

/* ==================== */
/* CUSTOM SCROLLBARS    */
/* ==================== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(ellipse at top, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
}

/* App Container */
.app {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* ==================== */
/* TIMERS SECTION       */
/* ==================== */

.timers-section {
  margin-bottom: var(--space-xl);
}

.timers-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px var(--success-glow);
  animation: pulse-glow 2s ease-in-out infinite;
  cursor: pointer;
  position: relative;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px var(--success-glow); }
  50% { box-shadow: 0 0 25px var(--success-glow); }
}

.timer-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.timer-ancestry {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.timer-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timer-display {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.timer-time {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--success);
  letter-spacing: 0.05em;
  min-width: 100px;
  text-align: right;
}

.timer-stop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 0 10px var(--danger-glow);
}

.timer-stop-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--danger-glow);
}

.timer-stop-btn svg {
  width: 16px;
  height: 16px;
}

/* Timer delete button (hangs off bottom-right, overlaps content below) */
.timer-delete-tray {
  position: absolute;
  bottom: 0;
  right: var(--space-lg);
  transform: translateY(0%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 5;
}

.timer-delete-tray.hidden {
  display: none;
}

.timer-card:hover .timer-delete-tray:not(.hidden) {
  transform: translateY(100%);
  opacity: 1;
  pointer-events: auto;
}

.timer-delete-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 3px var(--space-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.timer-delete-btn:hover {
  color: var(--danger);
}

.timer-delete-btn svg {
  width: 12px;
  height: 12px;
}

/* ==================== */
/* SEARCH SECTION       */
/* ==================== */

.search-section {
  margin-bottom: var(--space-xl);
}

.search-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.context-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  width: fit-content;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.context-path {
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-weight: 500;
}

.context-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.context-clear:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.search-input {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  outline: none;
  transition: all var(--transition-normal);
}

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

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.search-clear {
  position: absolute;
  right: var(--space-md);
  bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-clear:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ==================== */
/* ITEMS GRID           */
/* ==================== */

.items-section {
  flex: 1;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.item-ancestry-badge {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.item-main {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  min-height: 60px;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.item-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.item-stat + .item-stat::before {
  content: '·';
  margin-right: 4px;
  color: rgba(255, 255, 255, 0.25);
}

.stats-wrapped .item-stat + .item-stat::before {
  content: none;
}

.item-stat-label {
  opacity: 0.7;
}

.item-stat-value {
  color: var(--text-secondary);
}

.badge-group {
  position: relative;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 3px;
}

.badge-group.has-client {
  width: 16px;
  height: 16px;
}

.badge-activity {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
}

.badge-client {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  position: absolute;
  bottom: -1px;
  right: -1px;
  border: 1.5px solid var(--bg-card);
}

.item-card:hover .badge-client {
  border-color: var(--bg-card-hover);
}

.item-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  padding: var(--space-md) 0;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.item-expand:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

/* Active timer indicator on item */
.item-card.is-active {
  border-color: var(--success);
  box-shadow: 0 0 10px var(--success-glow);
}

.item-card.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--success);
}

/* Selected item (keyboard navigation) */
.item-card.is-selected {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ==================== */
/* EMPTY STATE          */
/* ==================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
}

.empty-message {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

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

/* ==================== */
/* ADD ITEM BUTTON      */
/* ==================== */

.add-item-btn {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--bg-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: all var(--transition-normal);
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { 
    opacity: 0; 
    transform: translateX(-50%) translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
  }
}

.add-item-btn:hover {
  background: var(--accent-secondary);
  transform: translateX(-50%) scale(1.02);
}

.add-icon {
  font-size: 1.25rem;
  font-weight: 700;
}

.add-text {
  white-space: nowrap;
}

#add-item-name {
  font-weight: 700;
}

/* ==================== */
/* RESPONSIVE           */
/* ==================== */

@media (max-width: 600px) {
  .app {
    padding: var(--space-md);
  }
  
  .search-input {
    font-size: 1.1rem;
    padding: var(--space-md) var(--space-lg);
  }
  
  .items-grid {
    grid-template-columns: 1fr;
  }
  
  .timer-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  
  .timer-display {
    width: 100%;
    justify-content: space-between;
  }
}

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

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-card-hover) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

.skeleton-card {
  height: 80px;
}

/* ==================== */
/* TIMELINE SECTION     */
/* ==================== */

.timeline-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-total {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

/* Today Timeline */
.timeline-today {
  position: relative;
  height: 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.timeline-bar {
  position: relative;
  height: 100%;
  display: flex;
}

.timeline-segment {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid var(--bg-primary);
  transition: all var(--transition-fast);
}

.timeline-segment:hover {
  filter: brightness(1.2);
}

.timeline-segment-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.timeline-hours {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0 2px;
}

/* Week Timeline */
.timeline-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: var(--space-sm);
}

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

.timeline-day-header {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-xs) 0;
}

.timeline-day-header.is-today {
  color: var(--accent-primary);
  font-weight: 600;
}

.timeline-day-bar {
  height: 60px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
}

.timeline-day-segment {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 4px;
}

.timeline-day-segment:hover {
  filter: brightness(1.2);
}

.timeline-day-total {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: center;
  padding-top: 2px;
}

/* Timeline segment colors are now applied via inline styles from JavaScript */

/* Empty state for timeline */
.timeline-empty {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Timeline legend */
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.timeline-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.timeline-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

@media (max-width: 600px) {
  .timeline-week {
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
  }
  
  .timeline-day-header {
    font-size: 0.6rem;
  }
  
  .timeline-day-bar {
    height: 40px;
  }
}

/* ==================== */
/* TOP-LEVEL NAV        */
/* ==================== */

.top-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  justify-content: center;
}

.top-nav-item {
  padding: var(--space-xs) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.top-nav-item:hover {
  color: var(--text-secondary);
}

.top-nav-item.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-primary);
}

/* ==================== */
/* SECTION PLACEHOLDERS */
/* ==================== */

.section-placeholder {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg);
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-content {
  text-align: center;
}

.placeholder-title {
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.placeholder-subtitle {
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--text-muted);
}

.section-placeholder:has(.embedded-app) {
  max-width: none;
  padding: 0;
  min-height: 0;
  height: calc(100vh - 40px);
  display: block;
}

.section-placeholder .embedded-app {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ==================== */
/* HABITS               */
/* ==================== */

.habits-container {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.habits-zone {
  margin-bottom: var(--space-2xl);
}

.habits-zone-title {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* Anytime habit buttons */
.anytime-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.anytime-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.anytime-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.anytime-btn:active {
  transform: scale(0.97);
}

.anytime-btn--positive:hover {
  border-color: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
}

.anytime-btn--negative:hover {
  border-color: var(--danger);
  box-shadow: 0 0 12px var(--danger-glow);
}

.anytime-btn .habit-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.anytime-btn--positive .habit-count.has-count {
  background: var(--success);
  color: #fff;
}

.anytime-btn--negative .habit-count.has-count {
  background: var(--danger);
  color: #fff;
}

.anytime-btn--neutral .habit-count.has-count {
  background: var(--accent-primary);
  color: #fff;
}

.anytime-btn .habit-delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.anytime-btn:hover .habit-delete {
  display: inline-flex;
}

.anytime-btn .habit-delete:hover {
  color: var(--danger);
  background: var(--danger-glow);
}

/* Daily habit checklist */
.daily-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.daily-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.daily-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.daily-check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--text-muted);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.daily-item.checked .daily-check {
  border-color: var(--success);
  background: var(--success);
}

.daily-check-icon {
  display: none;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
}

.daily-item.checked .daily-check-icon {
  display: block;
}

.daily-name {
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--text-primary);
  flex: 1;
}

.daily-item.checked .daily-name {
  color: var(--text-muted);
  text-decoration: line-through;
}

.daily-item .habit-delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.daily-item:hover .habit-delete {
  display: inline-flex;
}

.daily-item .habit-delete:hover {
  color: var(--danger);
  background: var(--danger-glow);
}

/* Add habit form */
.habits-add-toggle {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.habits-add-toggle:hover {
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

.habits-add-form {
  margin-top: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.habits-add-name {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  outline: none;
  margin-bottom: var(--space-md);
}

.habits-add-name:focus {
  border-color: var(--accent-primary);
}

.habits-add-options {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-md);
}

.habits-radio-group {
  border: none;
  padding: 0;
}

.habits-radio-group legend {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.habits-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.habits-radio-group input[type="radio"] {
  accent-color: var(--accent-primary);
}

.habits-add-actions {
  display: flex;
  gap: var(--space-sm);
}

.habits-add-submit {
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.habits-add-submit:hover {
  background: var(--accent-secondary);
}

.habits-add-cancel {
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.habits-add-cancel:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Empty state for habits zones */
.habits-empty {
  padding: var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-size: 0.875rem;
}

/* ==================== */
/* NAVIGATION TABS      */
/* ==================== */

.nav-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
  padding: var(--space-xs);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  text-align: center;
}

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

.nav-tab.active {
  color: var(--bg-primary);
  background: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ==================== */
/* PAGE SWITCHING       */
/* ==================== */

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ==================== */
/* DASHBOARD LANDING    */
/* ==================== */

.dashboard-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.dashboard-title {
  font-family: var(--font-primary);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.dashboard-subtitle {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-3xl) 0;
}

.dashboard-nav-cards {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
  justify-content: center;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-2xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  min-width: 200px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.dashboard-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-2px);
}

.dashboard-card-icon {
  width: 40px;
  height: 40px;
  color: var(--accent-primary);
}

.dashboard-card-title {
  font-family: var(--font-primary);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-card-desc {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==================== */
/* DASHBOARD PANELS     */
/* ==================== */

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  padding-top: var(--space-md);
}

.dashboard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: border-color var(--transition-fast);
}

.dashboard-panel:hover {
  border-color: var(--border-accent);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.panel-badge.offset-normal {
  color: var(--accent-primary);
  background: rgba(6, 182, 212, 0.12);
}

.panel-badge.offset-off {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
}

/* DST Countdown Panel */

.dst-countdown {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  justify-content: center;
  padding: var(--space-md) 0;
}

.dst-countdown-value {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.dst-countdown-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: lowercase;
}

.dst-countdown-date {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.dst-upcoming {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.dst-upcoming-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dst-upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.dst-upcoming-dates {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Tax Deadline Panel */

.tax-countdown {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  justify-content: center;
  padding: var(--space-md) 0;
}

.panel-badge.tax-urgent {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

.panel-badge.tax-warning {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
}

.panel-badge.tax-ok {
  color: var(--accent-primary);
  background: rgba(6, 182, 212, 0.12);
}

.tax-quarters {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.dst-upcoming-item.tax-next {
  color: var(--text-primary);
  font-weight: 600;
}

.dst-upcoming-item.tax-past {
  opacity: 0.4;
}

@media (max-width: 600px) {
  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .dst-countdown-value {
    font-size: 1.6rem;
  }
}

/* ==================== */
/* TIMESHEET LAYOUT     */
/* ==================== */

.timesheet-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-lg);
  min-height: calc(100vh - 150px);
}

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

/* ==================== */
/* SIDEBAR              */
/* ==================== */

.timesheet-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-back {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-back:hover {
  background: var(--bg-tertiary);
}

.sidebar-back svg {
  width: 16px;
  height: 16px;
}

.sidebar-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-filter-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.sidebar-filter-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.sidebar-filter-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.sidebar-filter-btn .filter-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sidebar-filter-all {
  margin-bottom: var(--space-sm);
  background: transparent;
  border: 1px dashed var(--border-subtle);
}

.sidebar-filter-all:hover {
  border-style: solid;
}

/* Expandable sidebar items */
.sidebar-item-wrapper {
  padding-left: calc(var(--depth, 0) * var(--space-md));
}

.sidebar-filter-btn .filter-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.sidebar-filter-btn .filter-chevron svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.sidebar-filter-btn .filter-chevron.expanded {
  transform: rotate(90deg);
}

.sidebar-filter-btn .filter-chevron-spacer {
  width: 16px;
  flex-shrink: 0;
}

.sidebar-filter-btn.active .filter-chevron svg {
  opacity: 1;
}

/* ==================== */
/* TIMESHEET MAIN       */
/* ==================== */

.timesheet-main {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.timesheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.timesheet-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timesheet-count {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.timesheet-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  font-size: 1rem;
}

/* ==================== */
/* ENTRY LIST           */
/* ==================== */

.entry-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.entry-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.entry-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.entry-item.is-active {
  border-color: var(--success);
  box-shadow: 0 0 10px var(--success-glow);
}

.entry-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.entry-activity {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-ancestry {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--font-mono);
}

.entry-duration {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-primary);
}

.entry-dates {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.entry-actions {
  display: flex;
  gap: var(--space-xs);
}

.entry-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.entry-delete-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.entry-delete-btn svg {
  width: 16px;
  height: 16px;
}

/* Entry List Loader */
.entry-list-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loader-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

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

/* ==================== */
/* MODAL                */
/* ==================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
  animation: modal-fade-in 0.2s ease;
}

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

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-slide-up 0.25s ease;
}

@keyframes modal-slide-up {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-small {
  max-width: 360px;
}

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

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

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.modal-body {
  padding: var(--space-lg);
  color: var(--text-secondary);
}

.modal-form {
  padding: var(--space-lg);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
}

/* ======================== */
/* BREAK TIMELINE           */
/* ======================== */

.break-timeline {
  margin-top: var(--space-sm);
  user-select: none;
}

.break-timeline-bar {
  position: relative;
  height: 36px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  overflow: visible;
  cursor: pointer;
}

.break-segment {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  transition: filter var(--transition-fast);
  pointer-events: none;
}

.break-segment:hover {
  filter: brightness(1.15);
}

.break-gap {
  position: absolute;
  top: 0;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-primary),
    var(--bg-primary) 3px,
    rgba(148, 163, 184, 0.08) 3px,
    rgba(148, 163, 184, 0.08) 6px
  );
  cursor: pointer;
  z-index: 1;
  transition: background var(--transition-fast);
}

.break-gap:hover {
  background: repeating-linear-gradient(
    -45deg,
    rgba(239, 68, 68, 0.15),
    rgba(239, 68, 68, 0.15) 3px,
    rgba(239, 68, 68, 0.08) 3px,
    rgba(239, 68, 68, 0.08) 6px
  );
}

.break-gap-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.break-gap:hover .break-gap-label {
  opacity: 1;
}

.break-handle {
  position: absolute;
  top: -2px;
  width: 10px;
  height: calc(100% + 4px);
  background: var(--accent-primary);
  border-radius: 3px;
  cursor: ew-resize;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
}

.break-timeline-bar:hover .break-handle,
.break-handle.dragging {
  opacity: 1;
}

.break-handle:hover,
.break-handle.dragging {
  box-shadow: 0 0 8px var(--accent-glow);
  background: var(--accent-secondary);
}

.break-handle-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

.break-handle:hover .break-handle-tooltip,
.break-handle.dragging .break-handle-tooltip {
  opacity: 1;
}

.break-handle-left {
  transform: translateX(-50%);
}

.break-handle-right {
  transform: translateX(50%);
}

.break-timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  position: relative;
  height: 14px;
}

.break-timeline-label {
  position: absolute;
  transform: translateX(-50%);
}

.break-timeline-label:first-child {
  transform: translateX(0);
}

.break-timeline-label:last-child {
  transform: translateX(-100%);
}

.break-timeline-tick {
  position: absolute;
  top: -4px;
  width: 1px;
  height: 4px;
  background: var(--text-muted);
  opacity: 0.3;
  transform: translateX(-50%);
}

/* ==================== */
/* FORM ELEMENTS        */
/* ==================== */

.form-group {
  margin-bottom: var(--space-lg);
}

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

.form-hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.datetime-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.datetime-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.datetime-input::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* ==================== */
/* BUTTONS              */
/* ==================== */

.btn {
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-secondary);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

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

.btn-danger:hover {
  background: #dc2626;
}

/* ==================== */
/* TYPEAHEAD            */
/* ==================== */

.typeahead-wrapper {
  position: relative;
}

.typeahead-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
}

.typeahead-badge-text {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typeahead-badge-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: 50%;
  color: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.typeahead-badge-clear:hover {
  background: rgba(0, 0, 0, 0.3);
}

.typeahead-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.typeahead-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.typeahead-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-xs);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.typeahead-item {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.typeahead-item:hover,
.typeahead-item.selected {
  background: var(--bg-card-hover);
}

.typeahead-item-ancestry {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.typeahead-empty {
  padding: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==================== */
/* TIME ADJUST BUTTONS  */
/* ==================== */

.time-adjust-row {
  display: flex;
  gap: 4px;
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.time-adjust-btn {
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 36px;
  text-align: center;
}

.time-adjust-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

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

/* Days - Amber/Orange */
.time-adjust-btn.days {
  background: #f59e0b;
  color: #1a1a1a;
}

.time-adjust-btn.days:hover {
  background: #fbbf24;
}

/* Hours - Purple */
.time-adjust-btn.hours {
  background: #8b5cf6;
  color: white;
}

.time-adjust-btn.hours:hover {
  background: #a78bfa;
}

/* Quarter hours (15m) - Teal */
.time-adjust-btn.quarter {
  background: #14b8a6;
  color: white;
}

.time-adjust-btn.quarter:hover {
  background: #2dd4bf;
}

/* Minutes - Blue */
.time-adjust-btn.minutes {
  background: #3b82f6;
  color: white;
}

.time-adjust-btn.minutes:hover {
  background: #60a5fa;
}

/* Now - Accent/Cyan */
.time-adjust-btn.now {
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-weight: 600;
}

.time-adjust-btn.now:hover {
  background: var(--accent-secondary);
}

/* Disabled state */
.time-adjust-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.time-adjust-btn:disabled:hover {
  transform: none;
  filter: none;
}

/* ==================== */
/* CONTEXT MENU         */
/* ==================== */

.context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs);
  animation: context-menu-appear 0.15s ease;
}

@keyframes context-menu-appear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.context-menu-item:hover {
  background: var(--bg-card-hover);
}

.context-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.context-menu-item.context-menu-danger:hover {
  background: var(--danger);
  color: white;
}

.context-menu-item:disabled,
.context-menu-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.context-menu-item:disabled:hover,
.context-menu-item.disabled:hover {
  background: transparent;
  color: var(--text-primary);
}

.context-menu-item.context-menu-danger:disabled:hover,
.context-menu-item.context-menu-danger.disabled:hover {
  background: transparent;
  color: var(--text-primary);
}

/* Tooltip for disabled delete */
.context-menu-item[title]:disabled:hover::after,
.context-menu-item[title].disabled:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 2001;
}

/* ==================== */
/* TEXT INPUT           */
/* ==================== */

.text-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

select.text-input {
  appearance: auto;
  cursor: pointer;
}

select.text-input option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ==================== */
/* RESPONSIVE MOBILE    */
/* ==================== */

@media (max-width: 768px) {
  .timesheet-sidebar {
    max-height: none;
  }
  
  .entry-item {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .entry-time {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .entry-actions {
    justify-content: flex-end;
  }
}

/* ==================== */
/* CLIENTS PAGE         */
/* ==================== */

.clients-page {
  display: flex;
  flex-direction: column;
}

.clients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.clients-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.clients-count {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.clients-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
  gap: var(--space-sm);
}

.clients-empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Client Card */
.client-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.client-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.client-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.client-card-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--bg-secondary);
}

.client-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.client-card-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.client-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-md) var(--space-lg);
}

.client-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.client-card-activity {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.client-card-meta {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

.client-card-projects {
  color: var(--accent-primary);
}

.client-card-rate {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  margin-top: 2px;
}

.client-card-stats {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 4px;
}

.client-card-stats > span + span::before {
  content: '·';
  margin-right: var(--space-sm);
  color: rgba(255, 255, 255, 0.25);
}

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

/* ==================== */
/* CLIENT DETAIL PAGE   */
/* ==================== */

.client-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.client-detail-header {
  display: flex;
  align-items: center;
}

.client-detail-back {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity var(--transition-fast);
}

.client-detail-back:hover {
  opacity: 0.8;
}

.client-detail-back svg {
  width: 18px;
  height: 18px;
}

.client-detail-hero {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.client-detail-logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.client-detail-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--bg-tertiary);
}

.client-detail-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.client-detail-logo-actions {
  display: flex;
  gap: var(--space-xs);
}

.client-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.client-detail-name-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.client-detail-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.client-detail-activity {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: calc(-1 * var(--space-sm));
}

.client-detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.client-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.client-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.client-field-input {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
}

/* Color Picker */
.client-color-picker {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.client-color-picker input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.client-color-picker input[type="color"]:hover {
  border-color: var(--accent-primary);
}

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

/* Small button variant */
.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
}

/* ==================== */
/* CLIENT STATS         */
/* ==================== */

.client-detail-section {
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.client-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.client-section-count {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 400;
}

.client-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
}

.client-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.client-stat-value {
  font-size: 1.1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-primary);
}

.client-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==================== */
/* CLIENT PROJECTS LIST */
/* ==================== */

.client-projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.client-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.client-project-item:hover {
  border-color: var(--accent-primary);
}

.client-project-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-project-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.client-project-rate {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

.client-project-rate.inherited {
  color: var(--text-muted);
  opacity: 0.7;
}

.client-project-actions {
  display: flex;
  gap: var(--space-xs);
}

.client-projects-empty {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .client-detail-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .client-detail-name-row {
    justify-content: center;
  }
  
  .client-detail-fields {
    grid-template-columns: 1fr 1fr;
  }
  
  .client-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ================================================================
   Money Toggle Buttons
   ================================================================ */

.money-toggles {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.money-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 30, 30, 0.85);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.money-toggle-btn:hover {
  background: rgba(50, 50, 50, 0.9);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

.sats-toggle-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sats-toggle.active {
  background: rgba(247, 147, 26, 0.2);
  border-color: rgba(247, 147, 26, 0.5);
  color: #f7931a;
}

/* Hide money values when toggled off */
body.hide-money .money-value {
  display: none !important;
}

/* Hide sats toggle when money is hidden */
body.hide-money .sats-toggle {
  display: none;
}

/* Dim the money button when money is hidden */
body.hide-money .money-toggle-btn:not(.sats-toggle) {
  opacity: 0.4;
}

/* Timer money display */
.timer-money {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

/* Item card money display */
.item-stat .money-value {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  margin-left: 0.2em;
}

/* ==================== */
/* TIMEZONE APPLET      */
/* ==================== */

.tz-grid {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
  min-height: 200px;

  /* Break out of the 800px .app container to span the full viewport */
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
  box-sizing: border-box;

  justify-content: center;
}

.tz-column {
  min-width: 150px;
  max-width: 200px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tz-column.is-workday {
  border-color: var(--success);
  box-shadow: 0 0 10px var(--success-glow);
}

.tz-column.is-workday .tz-header-time24 {
  color: var(--success);
}

.tz-header {
  text-align: center;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-xs);
}

.tz-header-title {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
}

.tz-header-time24 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1.2;
}

.tz-header-time12 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: -2px;
}

.tz-header-diff {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.tz-header-diff strong {
  color: var(--text-secondary);
}

.tz-person-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.tz-person-card:hover {
  background: var(--bg-card-hover);
}

.tz-person-card.is-workday-custom {
  border: 1px solid var(--success);
  box-shadow: 0 0 10px var(--success-glow);
}

.tz-person-card.is-offday-custom {
  border: 1px solid var(--danger);
  box-shadow: 0 0 10px var(--danger-glow);
}

.tz-person-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.tz-person-name {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.tz-person-city {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

/* Keyboard Legend */
.tz-legend {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tz-legend-title {
  font-weight: 600;
  color: var(--text-secondary);
}

.tz-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tz-legend kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  min-width: 22px;
  text-align: center;
}

.tz-time-offset-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--warning);
  margin-left: auto;
}

.tz-offset-badge-wrapper {
  position: absolute;
  top: 8px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--warning);
  display: none;
}

.tz-offset-badge-wrapper.visible {
  display: block;
}

/* People Editor */
.tz-people-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.tz-people-title {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.btn-add-person {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bg-primary);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-add-person:hover {
  background: var(--accent-secondary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Person Form */
.tz-person-form {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.tz-form-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.tz-form-field {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.tz-form-field label {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.tz-form-field input[type="text"],
.tz-form-field input[type="url"],
.tz-form-field select {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.tz-form-field input:focus,
.tz-form-field select:focus {
  border-color: var(--accent-primary);
}

.tz-form-field input[type="file"] {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.tz-form-field input[type="file"]::file-selector-button {
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: var(--space-sm);
}

/* Avatar mode tabs */
.tz-avatar-options {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.tz-avatar-tab {
  padding: 3px 10px;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tz-avatar-tab input[type="radio"] {
  display: none;
}

.tz-avatar-tab.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.tz-avatar-field {
  min-width: 100% !important;
}

.tz-form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.tz-form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.tz-form-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-save-person {
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bg-primary);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-save-person:hover {
  background: var(--accent-secondary);
}

.btn-cancel-person {
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel-person:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* People List */
.tz-people-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tz-people-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.tz-people-row:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.tz-people-row-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.tz-people-row-info {
  flex: 1;
  min-width: 0;
}

.tz-people-row-name {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.tz-people-row-meta {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tz-people-row-tz {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 140px;
}

.tz-people-row-client {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 100px;
}

.tz-people-row-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.tz-people-row-actions button {
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-edit-person {
  color: var(--accent-primary);
}

.btn-edit-person:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.btn-delete-person {
  color: var(--danger);
}

.btn-delete-person:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

/* ==================== */
/* LIFE IN WEEKS        */
/* ==================== */

.liw-grid-wrapper {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-md);
}

.liw-age-labels {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
  padding-top: 18px;
}

.liw-age-label {
  height: 9px;
  font-size: 8px;
  line-height: 9px;
  color: var(--text-muted);
  text-align: right;
  font-family: var(--font-mono);
  min-width: 28px;
}

.liw-grid {
  display: grid;
  grid-template-columns: repeat(52, 9px);
  gap: 1px;
}

.liw-week-header {
  font-size: 7px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
  line-height: 14px;
  height: 14px;
}

.liw-week {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  position: relative;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.liw-week:hover {
  border-color: var(--text-muted);
  z-index: 1;
}

.liw-week.past {
  background: var(--bg-tertiary);
}

.liw-week.colored {
  border-color: transparent;
}

.liw-week.current {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-glow);
}

.liw-week.offset {
  visibility: hidden;
}

.liw-day-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-primary);
  box-shadow: 0 0 3px rgba(241, 245, 249, 0.6);
  pointer-events: none;
}

.liw-tooltip {
  position: fixed;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border-subtle);
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.liw-tooltip-events {
  margin-top: 2px;
  font-family: var(--font-primary);
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.liw-no-birthday {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  color: var(--text-secondary);
  text-align: center;
}

.liw-no-birthday h2 {
  font-family: var(--font-primary);
  color: var(--text-primary);
  font-weight: 600;
}

.liw-no-birthday p {
  max-width: 400px;
}

.liw-no-birthday a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

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

/* Life in Weeks Legend */

.liw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-lg);
  padding: var(--space-sm) 0;
}

.liw-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.liw-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Life in Weeks Toggle */

.liw-grid-controls {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-md);
}

.liw-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.liw-toggle input {
  display: none;
}

.liw-toggle-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.liw-toggle input:not(:checked) ~ .liw-toggle-label:last-child {
  color: var(--text-muted);
}

.liw-toggle input:checked ~ .liw-toggle-label:last-child {
  color: var(--text-primary);
}

.liw-toggle .liw-toggle-label:first-of-type {
  color: var(--text-primary);
}

.liw-toggle input:checked ~ .liw-toggle-label:first-of-type {
  color: var(--text-primary);
}

.liw-toggle:has(input:not(:checked)) .liw-toggle-label:first-of-type {
  color: var(--text-primary);
}

.liw-toggle:has(input:checked) .liw-toggle-label:first-of-type {
  color: var(--text-muted);
}

.liw-toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.liw-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

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

.liw-toggle input:checked + .liw-toggle-slider::after {
  transform: translateX(16px);
  background: var(--bg-primary);
}

/* Life in Weeks Editor */

.liw-editor {
  max-width: 700px;
}

.liw-editor-section {
  margin-bottom: var(--space-xl);
}

.liw-editor-heading {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.liw-editor-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.liw-date-input {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  color-scheme: dark;
}

.liw-date-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.liw-color-input {
  width: 48px;
  height: 36px;
  padding: 2px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.liw-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.liw-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.liw-events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.liw-event-form {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.liw-event-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.liw-event-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.liw-event-item:hover {
  border-color: var(--border-accent);
}

.liw-event-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.liw-event-swatch.day-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-primary);
  box-shadow: 0 0 4px rgba(241, 245, 249, 0.4);
}

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

.liw-event-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.liw-event-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.liw-event-actions {
  display: flex;
  gap: var(--space-xs);
}

.liw-event-actions button {
  padding: 4px 8px;
  font-size: 0.78rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.liw-event-actions .liw-btn-edit:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.liw-event-actions .liw-btn-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}
