/* Mobile: floating pill-shaped bottom bar */
.nav:not(.pagy) {
  position: fixed;
  bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
  left: var(--space-md);
  right: var(--space-md);
  z-index: calc(var(--z-sticky) + 10);
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs) var(--space-sm);
  height: var(--nav-height);
}

.nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  min-height: 48px;
  justify-content: center;
}

.nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  transition: color var(--transition-fast);
  text-decoration: none;
  min-width: 64px;
  min-height: 48px;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  position: relative;
}

.nav__link:hover { color: var(--text); }
.nav__link--active { color: var(--text); }
.nav__link--active .nav__icon {
  background: var(--accent-muted);
  border-radius: var(--radius-full);
  padding: 3px;
}
/* Active dot indicator on mobile (dashboard only) */
.nav:not(.nav--admin) .nav__link--active::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  bottom: 4px;
}
.nav__link:active { transform: scale(0.95); }

.nav__links {
  display: contents;
}

.nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.nav__icon > svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav__label {
  font-size: var(--text-2xs);
  font-weight: var(--font-semibold);
  line-height: 1;
}

/* Section labels — hidden on mobile, shown on desktop */
.nav__section-label {
  display: none;
}

/* Notification count badge */
.nav__badge {
  font-size: var(--text-2xs);
  font-weight: var(--font-bold);
  background: var(--accent);
  color: var(--bg);
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  animation: pulse-ring 2s ease infinite;
}

/* Collapse button — hidden on mobile */
.nav__collapse {
  display: none;
}

/* Footer — hidden on mobile */
.nav__footer {
  display: none;
}

/* Hide desktop-only items on mobile */
.nav__link--desktop-only {
  display: none;
}

.nav__brand {
  display: none;
}

/* Mobile "Plus" nav button — styled like nav__link via class */
.nav__links button.nav__link {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  min-width: 64px;
  min-height: 48px;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  transition: color var(--transition-fast);
}


/* Overflow bottom sheet */
.nav-overflow {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
}

.nav-overflow--open {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.nav-overflow--closing {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.nav-overflow--closing .nav-overflow__backdrop {
  animation: fade-out 0.2s ease forwards;
}

.nav-overflow--closing .nav-overflow__panel {
  animation: slide-down-out 0.2s ease forwards;
}

.nav-overflow__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  animation: fade-in 0.2s ease;
}

.nav-overflow__panel {
  position: relative;
  background: var(--surface);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: var(--space-sm) 0 0;
  padding-bottom: calc(var(--nav-height) + var(--space-md) + env(safe-area-inset-bottom, 0px));
  animation: slide-up 0.2s var(--ease-out);
  will-change: transform;
}

/* Drag handle pill */
.nav-overflow__handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: var(--space-xs) auto var(--space-md);
  touch-action: none;
}

.nav-overflow__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px var(--space-lg);
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: background var(--transition-fast);
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font: inherit;
}

.nav-overflow__link:hover,
.nav-overflow__link:active {
  background: var(--surface-2);
}

.nav-overflow__link--danger {
  color: var(--danger);
}

.nav-overflow__link svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-overflow__link--danger svg {
  opacity: 1;
}

.nav-overflow__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-xs) var(--space-lg);
}

.nav-overflow__close {
  display: block;
  width: calc(100% - 2 * var(--space-lg));
  margin: var(--space-sm) auto 0;
  padding: 12px;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-overflow__close:hover {
  background: var(--surface-3);
  color: var(--text-secondary);
}

.nav-overflow__close:active {
  background: var(--surface-3);
  color: var(--text);
}

.nav__actions {
  display: none;
}

.nav__logout {
  display: contents;
}

.nav__logout button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  padding: var(--space-xs) var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  justify-content: center;
}

.nav__logout button:hover {
  color: var(--danger);
}

/* Main content */
.main-content {
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--nav-height) + var(--space-xl) + env(safe-area-inset-bottom, 0px));
  max-width: 1200px;
  margin: 0 auto;
  animation: content-in 200ms var(--ease-out);
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header__back {
  flex-basis: 100%;
  margin-bottom: calc(-1 * var(--space-sm));
}

.page-header__actions {
  display: flex;
  gap: var(--space-sm);
}

/* Glassmorphism header shadow on scroll */
.page-header--scrolled {
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .main-content {
    padding-top: 0;
  }

  .page-header {
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    margin: 0 calc(-1 * var(--space-lg)) var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    padding-top: calc(var(--space-md) + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border-subtle);
    transition: box-shadow var(--transition-base);
  }
}

/* Desktop: sidebar nav */
@media (min-width: 1024px) {
  .nav:not(.pagy) {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--sidebar-width);
    flex-direction: column;
    justify-content: flex-start;
    border: none;
    border-right: 1px solid var(--border);
    border-radius: 0;
    padding: var(--space-lg);
    padding-bottom: var(--space-lg);
    gap: var(--space-2xs);
    height: auto;
    background: var(--surface);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: width 0.25s var(--ease-out);
  }

  .nav__link--desktop-only {
    display: contents;
  }

  /* Remove mobile-only active dot on desktop */
  .nav__link--active::after {
    display: none;
  }

  .nav-overflow,
  .nav__more {
    display: none !important;
  }

  .nav__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding: var(--space-sm) 0;
  }

  .nav__logo {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
  }

  .nav__collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
  }

  .nav__collapse:hover {
    color: var(--text);
    background: var(--surface-2);
  }

  /* Section labels — overline dividers */
  .nav__section-label {
    display: block;
    font-size: var(--text-2xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: var(--space-md) var(--space-md) var(--space-xs);
  }

  .nav__item {
    flex-direction: row;
    width: 100%;
    min-height: auto;
  }

  .nav__link {
    flex-direction: row;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    width: 100%;
    min-width: auto;
    min-height: auto;
  }

  .nav__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    width: 100%;
    flex: 1;
    overflow-y: auto;
  }

  .nav__link:hover { background: var(--surface-2); }
  .nav__link--active {
    background: var(--surface-2);
    color: var(--text);
    border-left: 3px solid var(--text-faint);
    padding-left: calc(var(--space-md) - 3px);
  }
  .nav__link--active .nav__icon {
    background: none;
    border-radius: 0;
    padding: 0;
  }

  /* Sidebar footer — company name + plan */
  .nav__footer {
    display: block;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    margin-top: var(--space-md);
  }

  .nav__footer-company {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
  }

  .nav__footer-name {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }

  .nav__actions {
    display: flex;
    padding-top: var(--space-sm);
  }

  .nav__logout button {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    width: 100%;
    flex-direction: row;
    gap: var(--space-sm);
    font-size: var(--text-sm);
  }

  .nav__logout button:hover {
    background: var(--danger-bg);
  }

  .main-content {
    margin-left: var(--sidebar-width);
    margin-right: 0;
    max-width: 1400px;
    padding-bottom: var(--space-lg);
    padding-right: var(--space-xl);
    transition: margin-left 0.25s var(--ease-out);
  }

  /* Collapsed sidebar */
  .nav--collapsed:not(.pagy) {
    width: var(--sidebar-collapsed);
    padding: var(--space-md);
    align-items: center;
  }

  .nav--collapsed .nav__logo,
  .nav--collapsed .nav__label,
  .nav--collapsed .nav__section-label,
  .nav--collapsed .nav__footer,
  .nav--collapsed .nav__badge {
    display: none;
  }

  .nav--collapsed .nav__link {
    justify-content: center;
    padding: var(--space-sm);
    border-left: none;
  }

  .nav--collapsed .nav__link--active {
    padding-left: var(--space-sm);
    border-left: none;
    border-bottom: 2px solid var(--text-faint);
  }

  .nav--collapsed .nav__collapse svg {
    transform: rotate(180deg);
  }

  .nav--collapsed + .main-content,
  .nav--collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
  }

  /* Sidebar transition on main content */
  .nav:not(.pagy) {
    transition: width 0.25s var(--ease-out);
  }
}

/* Flash messages */
.flash {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  animation: flash-in 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.flash--notice {
  background: var(--success-bg);
  color: var(--success);
}

.flash--alert {
  background: var(--danger-bg);
  color: var(--danger);
}

.flash__dismiss {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: var(--space-xs);
  opacity: 0.7;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flash__dismiss:hover { opacity: 1; }

/* Auto-dismiss countdown bar */
.flash::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  animation: flash-countdown 5s linear forwards;
  transform-origin: left;
}

.flash--alert::after {
  animation-duration: 10s;
}

.flash:hover::after {
  animation-play-state: paused;
}

/* Stat cards grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (min-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

.empty-state__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-lg);
  color: var(--text-muted);
  opacity: 0.4;
}

.empty-state__icon > svg {
  width: 100%;
  height: 100%;
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  margin-bottom: var(--space-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   Dashboard grid — 2 column layout
   ═══════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 340px 1fr;
  }
}

.dashboard-grid__alerts {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ═══════════════════════════════════════
   Dashboard alert sections — grouped alerts
   ═══════════════════════════════════════ */
.dashboard-alert-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.dashboard-alert-section__header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-alert-section__icon {
  color: var(--text-faint);
  flex-shrink: 0;
}

.dashboard-alert-section__title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* ═══════════════════════════════════════
   Alert cards — colored left border + icon
   ═══════════════════════════════════════ */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--surface);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-lg);
  animation: fade-up 0.3s var(--ease-out) both;
}

.alert-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-card__content {
  flex: 1;
  min-width: 0;
}

.alert-card__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text);
  margin-bottom: var(--space-2xs);
}

.alert-card__description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

/* Alert variants */
.alert-card--warning {
  border-left-color: var(--warning);
}
.alert-card--warning .alert-card__icon {
  background: var(--warning-bg);
  color: var(--warning);
}

.alert-card--danger {
  border-left-color: var(--danger);
}
.alert-card--danger .alert-card__icon {
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-card--success {
  border-left-color: var(--success);
}
.alert-card--success .alert-card__icon {
  background: var(--success-bg);
  color: var(--success);
}

.alert-card--accent {
  border-left-color: var(--accent);
}
.alert-card--accent .alert-card__icon {
  background: var(--accent-muted);
  color: var(--accent);
}

/* Muted success — lightweight "all clear" inline text */
.alert-card--muted {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  font-size: var(--text-sm);
  color: var(--text-faint);
}

.alert-card--muted__icon {
  color: var(--success);
  font-size: var(--text-xs);
}

.alert-card--muted__text {
  font-weight: var(--font-medium);
}

/* ═══════════════════════════════════════
   Validation queue — card-based layout
   ═══════════════════════════════════════ */
.validation-queue {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ═══════════════════════════════════════
   Project tabs — cockpit navigation
   ═══════════════════════════════════════ */
.project-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
}

.project-tabs__tab {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.project-tabs__tab:hover {
  color: var(--text);
}

.project-tabs__tab--active {
  color: var(--text);
  border-bottom-color: var(--text-muted);
  font-weight: var(--font-semibold);
}

.project-tabs__panel {
  animation: fade-up 0.2s var(--ease-out);
}

/* ═══════════════════════════════════════
   Notes list — simple card stack
   ═══════════════════════════════════════ */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ═══════════════════════════════════════
   Week strip — horizontal calendar nav
   ═══════════════════════════════════════ */
.week-strip {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.week-strip__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.week-strip__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-lg);
  transition: color var(--transition-fast), background var(--transition-fast), transform 0.15s var(--ease-spring);
  flex-shrink: 0;
}

.week-strip__arrow:hover {
  color: var(--text);
  background: var(--surface-2);
}

.week-strip__arrow:active {
  transform: scale(0.9);
}

.week-strip__label {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text);
  text-transform: capitalize;
  text-align: center;
  letter-spacing: -0.01em;
}

.week-strip__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-sm);
}

.week-strip__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-sm) var(--space-xs);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.15s var(--ease-spring);
  border: 2px solid transparent;
  min-height: 76px;
  justify-content: center;
}

.week-strip__day:hover {
  background: var(--surface-2);
}

.week-strip__day:active {
  transform: scale(0.96);
}

.week-strip__day--today {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.week-strip__day--active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted), var(--shadow-sm);
}

.week-strip__day--active:hover {
  background: var(--accent);
}

.week-strip__day--active .week-strip__day-name,
.week-strip__day--active .week-strip__day-hours {
  color: inherit;
  opacity: 0.85;
}

.week-strip__day--empty:not(.week-strip__day--today):not(.week-strip__day--active) {
  opacity: 0.6;
}

.week-strip__day-name {
  font-size: var(--text-2xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.week-strip__day-number {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.week-strip__day-hours {
  font-size: var(--text-2xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.week-strip__day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
  margin-top: 3px;
}

.week-strip__day--active .week-strip__day-dot {
  background: currentColor;
  opacity: 0.5;
}

.week-strip__active-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  text-transform: capitalize;
  margin-bottom: var(--space-md);
}

.week-strip__clear-filter {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  min-height: 32px;
}

.week-strip__clear-filter:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
  .week-strip__days {
    gap: 3px;
  }

  .week-strip__day {
    padding: var(--space-xs) 2px;
    min-height: 72px;
  }

  .week-strip__day-name {
    font-size: 0.625rem;
  }

  .week-strip__day-hours {
    font-size: 0.625rem;
  }

  .filters .form-row {
    gap: var(--space-sm);
  }
}

/* ═══════════════════════════════════════
   Timeline — date-grouped timesheet view
   ═══════════════════════════════════════ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

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

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

.timeline__date {
  font-weight: var(--font-semibold);
  color: var(--text);
  font-size: var(--text-base);
  text-transform: capitalize;
}

.timeline__day-total {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

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

.timeline__entry {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.timeline__entry:hover {
  background: var(--surface-2);
}

.timeline__entry--today {
  background: var(--surface-2);
  border-left: 3px solid var(--border);
  padding-left: calc(var(--space-md) - 3px);
}

@media (min-width: 769px) {
  .timeline__entry-actions {
    opacity: 0;
    transition: opacity var(--transition-fast);
  }

  .timeline__entry:hover .timeline__entry-actions {
    opacity: 1;
  }
}

.timeline__entry-time {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.timeline__start,
.timeline__end { font-weight: var(--font-medium); }
.timeline__arrow { color: var(--text-faint); font-size: var(--text-2xs); user-select: none; }

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

.timeline__entry-worker {
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline__entry-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.timeline__entry-hours {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-base);
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.timeline__entry-status {
  text-align: center;
  min-width: 80px;
}

.timeline__entry-actions {
  display: flex;
  gap: var(--space-xs);
  justify-content: flex-end;
}

/* Timeline responsive */
@media (max-width: 768px) {
  .timeline__entry {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    padding: var(--space-sm);
  }

  .timeline__entry-time {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
  }

  .timeline__entry-info {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
  }

  .timeline__entry-hours {
    text-align: left;
    font-weight: var(--font-semibold);
  }

  .timeline__entry-status { text-align: left; min-width: auto; }

  .timeline__entry-actions {
    min-width: auto;
    padding-top: var(--space-xs);
    border-top: 1px solid var(--border-subtle);
    opacity: 1;
  }

  .timeline__entry:active {
    background: var(--surface-2);
    transition-duration: 50ms;
  }

  .timeline__entry-hours {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    color: var(--text);
  }
}

/* ═══════════════════════════════════════
   Team grid — project members with contribution bar
   ═══════════════════════════════════════ */
.team-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.team-member {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
}

.team-member:hover {
  background: var(--surface-2);
}

.team-member__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.team-member__identity {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.team-member__name {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-member__hours {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  white-space: nowrap;
}

.team-member__hours strong {
  color: var(--text);
}

.team-member__bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.team-member__bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
  min-width: 2px;
}

.team-member__footer {
  display: flex;
  justify-content: flex-end;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.team-member:hover .team-member__footer {
  opacity: 1;
}

/* ═══════════════════════════════════════
   Worker grid — card-based team view
   ═══════════════════════════════════════ */
.worker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.worker-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border: 1px solid transparent;
  transition: border-color var(--transition-fast),
              background var(--transition-fast),
              transform 0.25s var(--ease-spring),
              box-shadow var(--transition-fast);
}

.worker-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.worker-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.worker-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.worker-card__identity {
  min-width: 0;
}

.worker-card__name {
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.worker-card__phone {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

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

.worker-card__stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}

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

.worker-card__stat-value {
  font-weight: var(--font-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.worker-card__actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: auto;
}

/* ═══════════════════════════════════════
   FAB — floating action button (worker)
   ═══════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-lg) + env(safe-area-inset-bottom, 0px));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
  transition: transform var(--ease-spring) 0.2s, box-shadow var(--transition-fast);
  text-decoration: none;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-xl);
}

.fab:active {
  transform: scale(0.95);
}

/* ═══════════════════════════════════════
   History week header
   ═══════════════════════════════════════ */
.history-week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  margin-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border-subtle);
}

.history-week-header__label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-week-header__total {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Mobile "Plus" button reset */
.nav__more {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  min-width: 64px;
  min-height: 48px;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  transition: color var(--transition-fast);
}

.nav__more:hover,
.nav__more:active { color: var(--text); }

/* ═══════════════════════════════════════
   Light theme overrides
   ═══════════════════════════════════════ */
[data-theme="light"] .nav:not(.pagy) {
  border-color: rgba(0, 0, 0, 0.06);
}

@media (min-width: 1024px) {
  [data-theme="light"] .nav:not(.pagy) {
    border-right-color: var(--border);
    background: var(--surface);
    background-image: none;
  }
}

/* Theme toggle button in sidebar footer */
.nav__theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  margin-bottom: var(--space-sm);
}

.nav__theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Turbo progress bar */
.turbo-progress-bar {
  background: var(--accent);
  height: 3px;
}
