/* Mobile: nav hidden (replaced by mobile-header + bottom sheet) */
.nav:not(.pagy) {
  display: none;
}

.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;
}
.nav__link:active { transform: scale(0.95); }

/* Nav divider + disabled — hidden on mobile (nav hidden), shown on desktop */
.nav__divider,
.nav__link--disabled {
  display: none;
}

.nav__links {
  display: contents;
}

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

.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;
}

/* 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;
}

/* Mobile header — company logo bar, hidden on desktop where sidebar has brand */
.mobile-header {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xs) var(--space-sm) var(--space-lg);
  padding-top: calc(var(--space-sm) + env(safe-area-inset-top, 0px));
  min-height: var(--mobile-header-h);
  box-sizing: border-box;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

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

.mobile-header__app-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.mobile-header__app-logo .app-logo {
  height: 45px;
  width: auto;
}

.mobile-header__menu {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast);
}

.mobile-header__menu:hover {
  color: var(--text);
}

/* Bottom handle — persistent swipe-up grip to open nav sheet */
.bottom-handle {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  justify-content: center;
  align-items: center;
  min-height: calc(44px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* Reset button styles */
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

.bottom-handle__pill {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  transition: background var(--transition-fast), width var(--transition-fast);
}

.bottom-handle:active .bottom-handle__pill {
  background: var(--text);
  width: 44px;
}

@media (max-width: 1023px) {
  .mobile-header {
    display: flex;
  }

  .bottom-handle {
    display: flex;
  }
}

.nav__brand {
  display: none;
}

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

.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-in forwards;
}

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

.nav-overflow__backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  animation: fade-in 0.2s var(--ease-out);
}

.nav-overflow__panel {
  position: relative;
  background: var(--surface);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: var(--space-sm) 0 0;
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - var(--space-xl));
  overflow-y: auto;
  font-size: var(--text-xs);
  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: var(--space-md) 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--active {
  color: var(--accent);
  background: var(--accent-muted);
}

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

.nav-overflow__link--disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

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

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

.nav-overflow__actions {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-lg);
}

.nav-overflow__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-overflow__action-btn:hover,
.nav-overflow__action-btn:active {
  color: var(--text);
  background: var(--surface-2);
}

.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: var(--space-md);
  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-2xl) + env(safe-area-inset-bottom, 0px));
  max-width: 1200px;
  margin: 0 auto;
  animation: content-in 0.2s var(--ease-out);
}

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


.page-header p {
  margin-bottom: 0;
}

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

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

/* Desktop: all page headers sticky */
@media (min-width: 1024px) {
  .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: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-2xl) calc(-1 * var(--space-lg));
    border-radius: 0;
    transition: box-shadow var(--transition-base);
  }
}

/* Mobile: form headers scroll with content (avoid 3 sticky bars) */
@media (max-width: 1023px) {
  .page-header--sticky {
    position: relative;
    margin: 0 calc(-1 * var(--space-lg)) var(--space-md);
    padding-top: var(--space-md);
    border-radius: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
}

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

@media (max-width: 768px) {
  .main-content {
    padding: var(--space-md);
    padding-top: 0;
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  }

  .page-header {
    position: sticky;
    top: var(--mobile-header-h);
    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-md)) var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    min-height: auto;
    gap: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
    transition: box-shadow var(--transition-base);
  }

  .page-header__back {
    flex-basis: auto;
    margin-bottom: 0;
  }

  .page-header h1 {
    font-size: var(--text-lg);
  }

  .page-header .text--muted {
    font-size: var(--text-xs);
  }

  .stats-grid {
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
  }

  .dashboard-grid {
    gap: var(--space-md);
    margin-top: var(--space-md);
  }
}

/* Desktop: sidebar nav */
@media (min-width: 1024px) {
  .nav:not(.pagy) {
    display: flex;
    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;
    z-index: calc(var(--z-dropdown) + 1);
    background: var(--surface);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: width 0.25s var(--ease-out);
  }

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

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

  .nav__brand-identity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-width: 0;
  }

  .nav__brand .company-logo {
    width: 100%;
    height: auto;
    max-width: 160px;
    border-radius: var(--radius-lg);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), max-width 0.25s var(--ease-out);
  }

  .nav__brand .company-logo--initials {
    width: 160px;
    height: 160px;
    font-size: var(--text-4xl);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), font-size 0.25s var(--ease-out);
  }

  .nav__app-logo {
    display: flex;
    justify-content: center;
    color: var(--accent);
    margin-bottom: var(--space-lg);
  }

  .nav__app-logo .app-logo {
    height: 45px;
    width: auto;
    transition: height 0.25s var(--ease-out);
  }

  .nav--collapsed .nav__app-logo .app-logo,
  html.sidebar-collapsed .nav__app-logo .app-logo {
    height: 45px;
  }

  .nav__collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-faint);
    cursor: pointer;
    position: fixed;
    top: var(--space-lg);
    left: calc(var(--sidebar-width) - 14px);
    z-index: calc(var(--z-sticky) + 11);
    opacity: 0;
    transition: color var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast), left 0.25s var(--ease-out);
  }

  .nav:not(.pagy):hover .nav__collapse {
    opacity: 1;
  }

  .nav__collapse:hover {
    color: var(--text-muted);
    background: var(--surface-3);
    border-color: var(--border);
  }

  /* Nav divider */
  .nav__divider {
    display: block;
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-xs) var(--space-md);
  }

  /* Disabled nav link */
  .nav__link--disabled {
    display: flex;
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
  }

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

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

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

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

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

  .nav__footer-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
  }

  .nav__footer-user {
    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: none;
    padding-bottom: var(--space-lg);
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
    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__label,
  .nav--collapsed .nav__footer,
  .nav--collapsed .nav__badge,
  .nav--collapsed .nav__divider,
  .nav--collapsed .nav__link--disabled {
    display: none;
  }

  .nav--collapsed .nav__brand {
    flex-direction: column;
    gap: var(--space-xs);
    margin-top: var(--space-2xl);
  }

  .nav--collapsed .nav__brand-identity {
    justify-content: center;
  }

  .nav--collapsed .nav__brand .company-logo,
  .nav--collapsed .nav__brand .company-logo--initials {
    width: 40px;
    height: 40px;
    max-width: 40px;
    font-size: var(--text-sm);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out);
  }

  .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 {
    left: calc(var(--sidebar-collapsed) - 14px);
  }

  .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);
  }

  /* Pre-Stimulus collapsed state: applied via html class from sidebar.js
     to prevent FOUC before Stimulus connect() adds .nav--collapsed */
  html.sidebar-collapsed .nav:not(.pagy) {
    width: var(--sidebar-collapsed);
    padding: var(--space-md);
    align-items: center;
    transition: none;
  }

  html.sidebar-collapsed .nav__label,
  html.sidebar-collapsed .nav__footer,
  html.sidebar-collapsed .nav__badge,
  html.sidebar-collapsed .nav__divider,
  html.sidebar-collapsed .nav__link--disabled {
    display: none;
  }

  html.sidebar-collapsed .nav__brand .company-logo,
  html.sidebar-collapsed .nav__brand .company-logo--initials {
    width: 40px;
    height: 40px;
    max-width: 40px;
    font-size: var(--text-sm);
    transition: none;
  }

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

  html.sidebar-collapsed .nav__collapse {
    left: calc(var(--sidebar-collapsed) - 14px);
  }

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

  html.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
    transition: none;
  }
}

/* ── Flash popup (matches PWA install card) ── */
.flash {
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  background-image: var(--gradient-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-sm);
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
  animation: flash-slide-up 300ms var(--ease-out) both;
}

.flash__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.flash__message {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.flash--notice .flash__icon { color: var(--success); }
.flash--alert .flash__icon { color: var(--danger); }

/* Mobile: fixed above bottom nav */
@media (max-width: 1023px) {
  #flash {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + var(--space-sm));
    left: var(--space-md);
    right: var(--space-md);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* Desktop: bottom-right popup, like PWA install */
@media (min-width: 1024px) {
  #flash {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    max-width: 400px;
  }
}

.flash__dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  font-size: var(--text-lg);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Auto-dismiss countdown bar */
.flash::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  animation: flash-countdown 5s linear 300ms forwards;
  transform-origin: left;
}

.flash--notice::after { background: var(--success); }
.flash--alert::after {
  background: var(--danger);
  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-2xl);
}

@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-4xl) var(--space-lg);
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
  position: relative;
}

/* Subtle concentric circle texture in the void */
.empty-state::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  border-radius: var(--radius-full);
  background: radial-gradient(
    circle,
    transparent 30%,
    var(--surface-2) 31%,
    var(--surface-2) 32%,
    transparent 33%,
    transparent 50%,
    var(--surface-2) 51%,
    var(--surface-2) 52%,
    transparent 53%,
    transparent 70%,
    var(--surface-2) 71%,
    var(--surface-2) 72%,
    transparent 73%
  );
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.empty-state > * {
  position: relative;
  z-index: 1;
}

.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);
}

@media (max-width: 768px) {
  .empty-state {
    padding: var(--space-2xl) var(--space-md);
  }

  .empty-state__icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
  }

  .empty-state__title {
    font-size: var(--text-lg);
  }
}

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

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

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

/* ═══════════════════════════════════════
   Dashboard home — split-pane layout
   ═══════════════════════════════════════ */

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

.dashboard-home {
  gap: var(--space-lg);
}

@media (max-width: 1023px) {
  .dashboard-home__projects {
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-sm);
    padding-top: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .main-content:has(.dashboard-home) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 0;
  }

  .main-content:has(.dashboard-home) > .page-header {
    margin-bottom: 0;
  }

  .dashboard-home {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .dashboard-home__events {
    flex: 0 1 auto;
    max-height: 40%;
    overflow-y: auto;
    margin: 0 calc(-1 * var(--space-lg));
    padding: 0 var(--space-lg);
    scrollbar-width: thin;
  }

  .dashboard-home__events .events-feed__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));
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
  }

  .dashboard-home__events::-webkit-scrollbar { width: 6px; }

  .dashboard-home__events::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
  }

  .dashboard-home__projects {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    margin: 0 calc(-1 * var(--space-lg));
    padding: 0 var(--space-lg) var(--space-2xl);
    scrollbar-width: thin;
  }

  .dashboard-home__projects > .section-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));
    padding: var(--space-sm) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
  }

  .dashboard-home__projects > .cards-stack {
    margin-top: var(--space-md);
  }

  .dashboard-home__projects::-webkit-scrollbar { width: 6px; }

  .dashboard-home__projects::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
  }

  .dashboard-home__events:empty {
    display: none;
  }
}

/* ═══════════════════════════════════════
   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: var(--tracking-wider);
  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);
}

@media (max-width: 768px) {
  .alert-card {
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  .alert-card__icon {
    width: 28px;
    height: 28px;
  }
}

/* ═══════════════════════════════════════
   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);
  min-height: 44px;
  display: flex;
  align-items: center;
  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 log — structured analysis timeline
   ═══════════════════════════════════════ */
.notes-log__compose {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.notes-log__compose-fields {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
}

.notes-log__compose-category {
  flex-shrink: 0;
  width: 130px;
}

.notes-log__compose-content {
  flex: 1;
  min-width: 0;
}

.notes-log__compose-content {
  width: 100%;
}

.notes-log__compose-actions {
  flex-shrink: 0;
}


.notes-log__entries {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.notes-log__entry {
  padding: var(--space-md);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.notes-log__entry-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.notes-log__author {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.notes-log__time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: auto;
}

.notes-log__delete {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
  margin-left: var(--space-xs);
}

.notes-log__delete:hover {
  color: var(--danger);
}

.notes-log__entry:hover .notes-log__delete {
  opacity: 1;
}

.notes-log__entry-content {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .notes-log__compose {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-log__compose-fields {
    flex-direction: column;
  }

  .notes-log__compose-category {
    width: 100%;
  }

  .notes-log__compose-actions {
    display: flex;
    justify-content: flex-end;
  }

  .notes-log__delete {
    opacity: 1;
  }
}


@media (max-width: 640px) {
  .filters .form-row {
    gap: var(--space-sm);
  }
}

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

@media (max-width: 768px) {
  .timeline {
    gap: var(--space-lg);
  }
}

.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: 768px) {
  .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;
}

@media (max-width: 768px) {
  .team-member {
    padding: var(--space-sm) var(--space-md);
  }
}

/* ═══════════════════════════════════════
   Team overview — compact bar chart on project overview tab
   ═══════════════════════════════════════ */
.team-overview {
  background: var(--surface);
  background-image: var(--gradient-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

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

.team-overview__title {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-overview__chart[hidden] {
  display: none;
}

.team-overview__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.team-overview__toggle:hover {
  color: var(--text);
  background: var(--surface-3);
}


/* ═══════════════════════════════════════
   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);
  background-image: var(--gradient-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border: 1px solid transparent;
  box-shadow: var(--shadow-card);
  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: var(--tracking-wide);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.worker-card__role-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface-alt, var(--accent-muted));
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.worker-card__sms-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
  flex-shrink: 0;
}

.worker-card__sms-actions .btn {
  padding: var(--space-xs);
  color: var(--text-muted);
  min-height: auto;
}

.worker-card__sms-actions .btn:hover {
  color: var(--accent);
}

.worker-card__sms-actions form {
  display: flex;
}

.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;
}

/* ═══════════════════════════════════════
   Button Dropdown — details/summary
   ═══════════════════════════════════════ */
.btn-dropdown {
  position: relative;
  display: inline-block;
}

.btn-dropdown > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
  cursor: pointer;
}

.btn-dropdown > summary::-webkit-details-marker { display: none; }
.btn-dropdown > summary::marker { display: none; content: ""; }

.btn-dropdown > summary svg:last-child {
  transition: transform 0.2s var(--ease-out);
}

.btn-dropdown[open] > summary svg:last-child {
  transform: rotate(180deg);
}

.btn-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-xs));
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs);
  z-index: var(--z-dropdown);
}

.btn-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: background 0.15s var(--ease-out);
}

.btn-dropdown__item:hover {
  background: var(--surface-hover);
}

/* ═══════════════════════════════════════
   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-fab);
  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);
}

/* 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); }

/* ═══════════════════════════════════════
   Desktop: constrain text-heavy sections
   ═══════════════════════════════════════ */
@media (min-width: 1024px) {
  .detail-list,
  .notes-log,
  .timeline,
  .validation-queue {
    max-width: 960px;
  }

  .cards-grid,
  .stats-grid,
  .worker-grid {
    gap: 20px;
  }
}

/* ═══════════════════════════════════════
   Wide desktop: better use of space
   ═══════════════════════════════════════ */
@media (min-width: 1440px) {
  .main-content {
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }

  .page-header {
    margin-left: calc(-1 * var(--space-2xl));
    margin-right: calc(-1 * var(--space-2xl));
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }

  .dashboard-grid {
    grid-template-columns: 380px 1fr;
  }

  .dashboard-home__projects {
    margin-left: calc(-1 * var(--space-2xl));
    margin-right: calc(-1 * var(--space-2xl));
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }

  .dashboard-home__projects > .section-header {
    margin-left: calc(-1 * var(--space-2xl));
    margin-right: calc(-1 * var(--space-2xl));
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }

  .dashboard-home__events {
    margin-left: calc(-1 * var(--space-2xl));
    margin-right: calc(-1 * var(--space-2xl));
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }

  .dashboard-home__events .events-feed__header {
    margin-left: calc(-1 * var(--space-2xl));
    margin-right: calc(-1 * var(--space-2xl));
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }
}

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

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

/* Theme toggle & settings buttons in sidebar footer */
.nav__theme-toggle,
.nav__footer-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}

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

/* ═══════════════════════════════════════
   Dashboard day detail — grouped by worker
   ═══════════════════════════════════════ */
.day-detail__worker-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-2xs);
}

.day-detail__worker-name {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--text);
  flex: 1;
}

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

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

.day-detail__worker-group:last-child {
  margin-bottom: 0;
}

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

/* ═══════════════════════════════════════
   Custom confirm dialog
   ═══════════════════════════════════════ */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.confirm-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  animation: fade-in 0.15s var(--ease-out);
}

.confirm-dialog__panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: scale-in 0.2s var(--ease-out);
}

.confirm-dialog__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.confirm-dialog__message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-xl);
}

.confirm-dialog__actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}
