.nav {
  border-bottom: none;
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 0.5rem 1rem 0;
  gap: 1rem;
  height: 4.5rem;
  flex-shrink: 0;
}

.nav__date-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  position: relative;}

.nav__controls {
  display: flex;
  gap: 0.125rem;
}

.nav__arrows {
  display: flex;
  gap: 0.125rem;
}

.nav__date {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #111827;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Actual date display element — more specific to override .button */
.nav .nav__date-btn,
.nav__date-btn#nav-minical-toggle {
  font-size: 1.3rem !important;
  font-weight: 600 !important;
  color: #111827;
  letter-spacing: -0.01em;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: auto;
}

@media (min-width: 768px) {
  .nav {
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1rem 0;
  }

  .nav__date-info {
    flex-direction: row;
    justify-content: flex-start;
    gap: 1rem;
  }

  .nav__controls {
    gap: 0.5rem;
  }
}
/* Search bar */
.nav__search {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  align-self: flex-start;
}

/* Botón lupa */
.search-toggle-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  position: relative;
  transition: background 0.15s;
  margin-top: 0.25rem;
}

.search-toggle-btn:hover {
  background: #e8eaed;
}

/* Tooltip */
.search-toggle-btn::after {
  content: "Buscar";
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(32,33,36,0.82);
  color: white;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}

.search-toggle-btn:hover::after {
  opacity: 1;
}

/* Barra expandida (oculta por defecto) */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--color-gray-300);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  width: 18rem;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0.5);
  transform-origin: right center;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.search-bar.search-bar--open {
  opacity: 1;
  transform: translateY(-50%) scaleX(1);
  pointer-events: auto;
}

.search-bar:focus-within {
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.search-bar__icon {
  color: var(--color-gray-400);
  flex-shrink: 0;
}

.search-bar__input {
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--font-size-sm);
  color: var(--color-text-dark);
  width: 100%;
}

.search-bar__input::placeholder {
  color: var(--color-gray-400);
}

.search-bar__clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-400);
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
}

.search-bar__clear:hover { color: var(--color-text-dark); }

/* Results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 20rem;
  background: white;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  z-index: 100;
  max-height: 24rem;
  overflow-y: auto;
}

.search-results__group {
  padding: 0.5rem 0;
}

.search-results__group-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 1rem;
}

.search-results__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--color-text-dark);
  transition: background 0.1s;
}

.search-results__item:hover { background: var(--color-gray-100); }

.search-results__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-results__date {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  margin-left: auto;
  white-space: nowrap;
}

.search-results__empty {
  padding: 1rem;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-gray-400);
}

.search-active .event {
  opacity: 0.25;
  pointer-events: none;
}
.search-active .event--match {
  opacity: 1 !important;
  pointer-events: auto;
}

/* Avatar en nav */
.nav__avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.15s;
  margin-left: 0.5rem;
}
.nav__avatar-btn:hover {
  background: #e8eaed;
}
.nav__avatar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.2;
}
.nav__avatar-company {
  font-size: 0.8rem;
  font-weight: 600;
  color: #3c4043;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav__avatar-user {
  font-size: 0.7rem;
  font-weight: 500;
  color: #9ca3af;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Avatar dropdown */
.avatar-dropdown {
  position: fixed;
  top: 4.25rem;
  right: 1rem;
  width: 20rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  border: 1px solid #e0e0e0;
  z-index: 1000;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: fdropIn 0.15s ease both;
}
.avatar-dropdown__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
}
.avatar-dropdown__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}
.avatar-dropdown__company {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar-dropdown__user {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar-dropdown__email {
  font-size: 0.78rem;
  color: #70757a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar-dropdown__divider {
  height: 1px;
  background: #e0e0e0;
  margin: 0.25rem 0;
}
.avatar-dropdown__menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.5rem;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #3c4043;
  text-align: left;
  transition: background 0.12s;
}
.avatar-dropdown__menu-item:hover {
  background: #f1f3f4;
}
.avatar-dropdown__menu-item--danger {
  color: #c5221f;
}
.avatar-dropdown__menu-item--danger:hover {
  background: #fce8e6;
}
/* Mobile: month picker button */
.nav__month-picker {
  display: none;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  padding: 0.25rem 0.1rem;
}
@media (max-width: 700px) {
  .nav__month-picker { display: flex; }
  .desktop-only { display: none !important; }
}

/* Mobile search fullscreen */
.mobile-search {
  display: none;
  position: fixed;
  inset: 0;
  background: white;
  z-index: 500;
  flex-direction: column;
}
.mobile-search.is-open { display: flex; }
.mobile-search__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
}
.mobile-search__back {
  background: none;
  border: none;
  cursor: pointer;
  color: #3c4043;
  display: flex;
  align-items: center;
  padding: 0.25rem;
  flex-shrink: 0;
}
.mobile-search__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #1a1a2e;
  background: transparent;
}
.mobile-search__results {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.mobile-search__hint {
  color: #9aa0a6;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 2rem;
}


/* Mobile sidebar override */
.mobile-sidebar__wrapper {
  width: 80vw !important;
  max-width: 18rem !important;
  background: white !important;
  background-color: white !important;
  padding: 1.25rem 1rem !important;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15) !important;
}
.mobile-sidebar__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

/* Month chip bar - Google Calendar style */
.month-chip-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 3.5rem;
  z-index: 100;
  background: white;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}
.month-chip-bar.is-open {
  max-height: 56px;
  overflow-x: auto;
  overflow-y: hidden;
}
.month-chip-bar::-webkit-scrollbar { display: none; }

.month-chip-bar__track {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  width: max-content;
  min-width: 100%;
  align-items: center;
}

.month-chip {
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #dadce0;
  background: #f8f9fa;
  color: #3c4043;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1.4;
  min-width: 3rem;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.month-chip:active { background: #e8eaed; }
.month-chip.is-current {
  background: #d2e3fc;
  border-color: #d2e3fc;
  color: #1a73e8;
  font-weight: 700;
}
.month-chip.is-year {
  border: none;
  background: none;
  color: #80868b;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
  padding: 0.3rem 0.1rem;
  min-width: unset;
}

/* Chip bar abierto: el calendario se achica hacia abajo suavemente */
@media (max-width: 700px) {
  .calendar {
    transition: padding-top 0.2s ease;
    padding-top: 0;
  }
  body.chip-bar-open .calendar {
    padding-top: 48px;
  }
}

/* Clickable dropdown header */
.avatar-dropdown__header--clickable {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem;
  margin: -0.5rem;
  width: calc(100% + 1rem);
  text-align: left;
  transition: background 0.15s;
}
.avatar-dropdown__header--clickable:hover {
  background: rgba(0,0,0,0.05);
}

/* ── Nav collapsed hamburger (desktop, shown only when sidebar is collapsed) ── */
.nav-hamburger-collapsed {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: #444;
  transition: background 0.15s;
  flex-shrink: 0;
}
.nav-hamburger-collapsed svg {
  width: 26px;
  height: 26px;
}
.nav-hamburger-collapsed:hover {
  background: #f1f3f4;
}
.app.sidebar-collapsed .nav-hamburger-collapsed {
  display: flex;
}

/* Logo +Sinergia en el nav — siempre oculto */
.nav__logo-collapsed {
  display: none !important;
}

/* ── View toggle (calendar / list) ── */
.nav-view-toggle {
  display: flex;
  align-items: center;
  background: #f1f3f4;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin-left: 0;
  margin-top: 0.25rem;
}

.nav-view-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.nav-view-btn--active {
  background: white;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.nav-view-btn:not(.nav-view-btn--active):hover {
  color: #374151;
}

/* ── Past toggle (iOS style) ── */
.nav-past-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
  margin-left: 0;
}

.nav-ios-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
}

.nav-ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.nav-ios-track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s;
}

.nav-ios-toggle input:checked + .nav-ios-track {
  background: #4095f6;
}

.nav-ios-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.nav-ios-toggle input:checked ~ .nav-ios-thumb {
  transform: translateX(14px);
}

/* ── Filter button ── */
.nav-filter-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.15s;
  align-self:flex-start;
  margin-top: 0.2rem;
}
.nav-filter-btn:hover {
  background: #e8eaed;
}
.nav-filter-btn--active {
  color: #1d4ed8;
  background: #eff6ff;
}

#filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── List controls (sort) in nav ── */
.nav-list-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-list-sort {
  font-size: 0.78rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 0.3rem 0.6rem;
  background: white;
  color: #374151;
  cursor: pointer;
  outline: none;
}
.nav-list-sort:focus {
  border-color: #4095f6;
}
