.sidebar {
  background: #f1f3f4;
  border-right: none;
  width: 17rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 1rem 1rem;
  overflow-y: auto;
  overflow-x: hidden;

  height: 100vh;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  padding-left: 0;
}

.sidebar__cuti-logo { height: 2.75rem; width: auto; flex-shrink: 0; }
.sidebar__title-block { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar__title { font-size: 0.85rem; font-weight: 600; color: #3c4043; letter-spacing: -0.01em; }

.sidebar__user {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar__user-info { display: flex; align-items: center; gap: 0.6rem; }

.user-avatar {
  width: 2.25rem; height: 2.25rem;
  min-width: 2.25rem; min-height: 2.25rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--font-size-md); font-weight: 700;
  flex-shrink: 0; text-transform: uppercase; letter-spacing: 0; line-height: 1;
}

.sidebar__user-details { display: flex; flex-direction: column; gap: 0.1rem; overflow: hidden; }
.sidebar__user-company { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-email { font-size: var(--font-size-xs); color: var(--color-gray-400); line-height: var(--line-height-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Eventos confirmados */
.sidebar__confirmed { display: flex; flex-direction: column; gap: 0.5rem; min-height: 0; }
.sidebar__confirmed-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #9ca3af; margin: 0 0 0.6rem 0; flex-shrink: 0;
}
.sidebar__confirmed .user-panel__events-list { max-height: calc(3 * 3.9rem); overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable; position: relative; }

/* Fade-out gradient at bottom of confirmed events list */
.sidebar__confirmed {
  position: relative;
}

.sidebar__confirmed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(to bottom, transparent, #f1f3f4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.sidebar__confirmed.scroll-faded::after {
  opacity: 1;
}

@media (max-width: 700px) { .mini-calendar { display: none; } }

/* Event items */
.user-panel__events-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.user-panel__event-item {
  display: flex !important; flex-direction: row !important; align-items: center !important;
  justify-content: space-between !important; gap: 0.5rem !important;
  padding: 0.45rem 0.6rem !important; border-radius: 0 6px 6px 0 !important;
  background: transparent !important; border-left: 3px solid #3b82f6 !important;
  box-shadow: none !important; cursor: pointer !important; transition: background 0.15s !important;
}
.user-panel__event-item:hover { background: #f1f5f9 !important; }
.user-panel__event-info { flex: 1; min-width: 0; }
.user-panel__event-title { font-size: 0.78rem !important; font-weight: 600 !important; color: #1a1a2e !important; line-height: 1.3 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.user-panel__event-date { font-size: 0.68rem !important; color: #9ca3af !important; margin-top: 0.05rem !important; }
.user-panel__event-days { font-size: 0.68rem !important; font-weight: 500 !important; color: #9ca3af !important; white-space: nowrap !important; flex-shrink: 0 !important; }
.user-panel__event-days.is-today { color: #16a34a !important; font-weight: 600 !important; }
.user-panel__event-days.is-ongoing { color: #16a34a !important; font-weight: 600 !important; }

/* Mobile sidebar */
.mobile-sidebar__content { background: white; flex: 1; padding-top: 5rem; }
.dialog--sidebar .dialog__wrapper { background: transparent !important; }

/* Logos */
.sidebar__logo-full { display: block; }
.sidebar__logo-full svg, .sidebar__logo-full img { width: 11rem; height: auto; display: block; }
.mobile-sidebar__logo { margin-top: -3.5rem; margin-bottom: 1.25rem; }
.mobile-sidebar__logo svg, .mobile-sidebar__logo img { width: 9rem; height: auto; display: block; }

/* Mobile two-view */
.msb-view { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: panelFadeIn 0.2s ease both; }
.msb-footer { margin-top: auto; padding-top: 1rem; }
.msb-empresa-btn { display: flex; align-items: center; gap: 0.5rem; background: none; border: none; font-size: 0.85rem; font-weight: 600; color: #374151; cursor: pointer; padding: 0.5rem 0; width: 100%; }
.msb-empresa-btn:hover { color: #1831b1; }
.msb-empresa-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; padding-bottom: 0.75rem; }
.msb-back-btn { background: none; border: none; cursor: pointer; color: #6b7280; padding: 0.25rem; display: flex; align-items: center; flex-shrink: 0; }
.msb-back-btn:hover { color: #1831b1; }
.msb-empresa-info { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.msb-company-name { font-size: 0.85rem; font-weight: 700; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msb-company-email { font-size: 0.72rem; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msb-empresa-sections { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; flex: 1; padding-bottom: 1rem; }
.msb-section { display: flex; flex-direction: column; gap: 0.4rem; }
.msb-section-header { display: flex; align-items: center; justify-content: space-between; }
.msb-section-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #9ca3af; }
.msb-section--tos { margin-top: 0.5rem; }
.msb-logout { margin-top: 0.5rem; align-self: flex-start; }

/* Desktop two-view */
@keyframes sidebarFadeIn { from { opacity: 0; } to { opacity: 1; } }
.sidebar-view { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: sidebarFadeIn 0.2s ease both; }
.sidebar-back-btn { display: flex; align-items: center; gap: 0.35rem; background: none; border: none; font-size: 0.8rem; font-weight: 600; color: #6b7280; cursor: pointer; padding: 0; }
.sidebar-back-btn:hover { color: #1831b1; }
.sidebar-empresa-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-shrink: 0; }
.sidebar-empresa-title { font-size: 0.95rem; font-weight: 700; color: #122159; }
.sidebar-empresa-body { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable; flex: 1; padding-right: 0.5rem; }
.sidebar-empresa-profile { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-empresa-name { font-size: 0.9rem; font-weight: 700; color: #122159; }
.sidebar-empresa-email { font-size: 0.75rem; color: #6b7280; }
.sidebar-empresa-section { display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-empresa-section-header { display: flex; align-items: center; justify-content: space-between; }
.sidebar-empresa-section-title { font-size: 0.8rem; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.04em; }
.sidebar-tos-content { display: flex; flex-direction: column; gap: 0.75rem; overflow-y: auto; flex: 1; font-size: 0.82rem; color: #4b5563; line-height: 1.6; }

/* CUTI footer logo */
.sidebar__cuti-footer-logo {
  display: block;
  width: 5rem;
  height: auto;
  margin-top: 0.75rem;
}
.sidebar__cuti-footer-logo img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Sidebar top bar with hamburger ── */
.sidebar__top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.3rem 0.25rem 0.5rem;
  gap: 0rem;
}
.sidebar-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  transition: background 0.15s;
}
.sidebar-hamburger:hover {
  background: #f1f3f4;
}

/* Slide-in animation for confirmed event items */
@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.event-item--slide-in {
  animation: slideInFromLeft 0.28s ease-out both;
  will-change: transform, opacity;
}


/* ── Skeleton loading ── */
@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.skeleton-line {
  background: #e5e7eb;
  border-radius: 4px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-title { height: 13px; width: 70%; margin-bottom: 5px; }
.skeleton-date  { height: 11px; width: 45%; }
.skeleton-pill  {
  background: #e5e7eb;
  border-radius: 10px;
  height: 20px; width: 48px;
  flex-shrink: 0;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-item  { pointer-events: none; }

.skeleton-avatar {
  background: #e5e7eb !important;
  color: transparent !important;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-company {
  display: inline-block;
  width: 80px; height: 12px;
  background: #e5e7eb;
  border-radius: 4px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}

/* ── Password field with eye toggle and tick ── */
.pwd-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-field-wrap .input {
  flex: 1;
  padding-right: 4rem;
}
.pwd-eye-btn {
  position: absolute;
  right: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  line-height: 1;
}
.pwd-eye-btn:hover { color: #6b7280; }
.pwd-tick {
  position: absolute;
  right: 0.4rem;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}

/* ── Inline field error messages ── */
.pwd-field-error {
  font-size: 0.75rem;
  color: #dc2626;
  padding: 0 0.1rem;
  margin-top: -0.15rem;
}

/* ── TOS overlay en área del calendario ── */
.tos-overlay {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  box-sizing: border-box;
}
@keyframes tosSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tos-overlay__box {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  padding: 2rem 2.5rem;
  animation: tosSlideUp 0.3s ease-out both;
}
.tos-overlay__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  padding: 0;
}
.tos-overlay__back:hover { color: #111827; }
.tos-overlay__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.tos-overlay__content {
  font-size: 0.875rem;
  line-height: 1.7;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.tos-overlay__content p { margin: 0; }

/* ── TOS overlay header and edit controls ── */
.tos-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tos-overlay__edit-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}
.tos-overlay__edit-btn:hover { background: #f3f4f6; }

.tos-overlay__textarea {
  width: 100%;
  min-height: 320px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
.tos-overlay__textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.tos-overlay__edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── Skeleton state for attendance button ── */
.skeleton-btn-loading {
  background: #e5e7eb !important;
  color: transparent !important;
  border-color: transparent !important;
  pointer-events: none;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-btn-loading svg { opacity: 0; }

/* Avatar skeleton */
.user-avatar--sm {
  width: 1.75rem; height: 1.75rem;
  min-width: 1.75rem; min-height: 1.75rem;
  font-size: 0.75rem;
}

.user-avatar--skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%) !important;
  background-size: 200% 100% !important;
  animation: avatarShimmer 1.4s ease-in-out infinite !important;
  color: transparent !important;
}

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

/* ── Rendering perf: skip layout/paint for hidden sidebar views ── */
.sidebar-view[style*="display:none"],
.sidebar-view[style*="display: none"] {
  content-visibility: hidden;
}
