/* Application shell, sidebar, header, and navigation. */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  display: flex;
  flex: 0 0 224px;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  box-sizing: border-box;
  min-height: 100vh;
  padding: 22px 14px 18px;
  border-right: 1px solid #e5e7eb;
  background: #fff;
  transition: flex-basis 180ms ease, width 180ms ease, padding 180ms ease;
}

.app-sidebar.is-collapsed { flex-basis: 58px; padding-left: 6px; padding-right: 6px; }

.app-sidebar__brand { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 8px 24px; }

.app-sidebar__brand-name { color: #111827; font-size: 0.95rem; font-weight: 650; }

.app-sidebar__toggle { display: grid; width: 28px; height: 28px; margin-left: auto; place-items: center; border: 0; border-radius: 8px; color: #6b7280; font-size: 1.4rem; line-height: 1; cursor: pointer; }

.app-sidebar__toggle:hover { background: #eef2ff; color: #4338ca; }

.app-sidebar__nav { display: flex; flex: 1; flex-direction: column; gap: 5px; }

.app-sidebar__link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #6b7280; font-size: 0.88rem; font-weight: 600; text-decoration: none; transition: background 150ms ease, color 150ms ease; }

.app-sidebar__link:hover { background: #f5f3ff; color: #4338ca; }

.app-sidebar__link.is-active { background: #eef2ff; color: #4338ca; font-weight: 600; }

.app-sidebar__link--settings { margin-top: auto; }

.app-sidebar__icon { display: grid; flex: 0 0 auto; width: 22px; place-items: center; font-size: 1.1rem; font-weight: 500; }

.app-sidebar__preview { margin: auto 4px 0; color: #6b7280; font-size: 0.75rem; font-weight: 500; text-align: center; }

.app-sidebar__dev { margin: 12px 4px; padding-top: 12px; border-top: 1px solid #e5e7eb; color: #6b7280; font-size: 0.75rem; }

.app-sidebar__profile-switcher { display: block; margin-top: 10px; color: #374151; font-size: 0.7rem; font-weight: 600; }

.app-sidebar__profile-select { width: 100%; margin-top: 4px; padding: 5px 6px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #374151; font: inherit; font-size: 0.72rem; }

.app-sidebar__dev p { margin-top: 8px; }

.app-sidebar__dev kbd { color: #4338ca; font: inherit; font-weight: 600; }

.app-sidebar.is-collapsed .app-sidebar__dev { display: none; }

.app-sidebar.is-collapsed .app-sidebar__brand-name,
.app-sidebar.is-collapsed .app-sidebar__link span:not(.app-sidebar__icon),
.app-sidebar.is-collapsed .app-sidebar__preview { display: none; }

.app-sidebar.is-collapsed .app-sidebar__brand { justify-content: center; padding-left: 0; padding-right: 0; }

.app-sidebar.is-collapsed .app-sidebar__toggle { margin-left: 0; }

.app-sidebar.is-collapsed .app-sidebar__link { justify-content: center; padding-left: 0; padding-right: 0; }

.app-sidebar.is-collapsed .app-sidebar__icon { width: 28px; font-size: 1.43rem; }

.app-sidebar.is-collapsed .app-sidebar__link::after {
  position: absolute;
  left: calc(100% + 9px);
  top: 50%;
  z-index: 30;
  display: none;
  padding: 6px 9px;
  border-radius: 7px;
  background: #111827;
  color: white;
  content: attr(data-label);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.app-sidebar.is-collapsed .app-sidebar__link:hover::after { display: block; }

.app-content { display: flex; min-width: 0; flex: 1; flex-direction: column; }

.app-content .calendar-main { flex: 1; }

.app-header { border-bottom: 1px solid #e5e7eb; background: #fff; }

.demo-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.25rem;
}

.demo-header__business { display: flex; align-items: center; gap: .75rem; }

#business-initials {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #1f2937;
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
}

#business-name {
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
}

.demo-header__actions { display: flex; align-items: center; gap: 16px; }

.today-summary { position: static; display: flex; min-width: 0; flex-direction: column; align-items: flex-end; gap: 3px; margin: 0 18px 0 auto; text-align: right; transform: none; }

.today-summary__label { color: #374151; font-size: .85rem; font-weight: 600; line-height: 1.1; }

.today-summary__greeting { color: #374151; font-size: .85rem; line-height: 1.1; white-space: nowrap; }

.today-summary__details { overflow: hidden; max-width: 360px; color: #6b7280; font-size: .85rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.today-summary__details strong { color: #374151; font-weight: 700; }

.connection-status { display: inline-flex; align-items: center; gap: 0.5rem; color: #4b5563; font-size: .68rem; font-weight: 650; line-height: 1.25; }

#connection-dot { width: 0.6rem; height: 0.6rem; flex-shrink: 0; border-radius: 9999px; background: #d1d5db; }

#connection-dot.connection-dot--connected { background: #22c55e; animation: connection-pulse 1.44s ease-in-out infinite; }

#connection-dot.connection-dot--reconnecting { background: #fbbf24; }

.connection-label--connected { color: #15803d; }

.connection-label--warning { color: #b45309; }

.calendar-main { width: 100%; padding: .75rem; }

.calendar-shell {
  padding: .5rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

#person-switcher { display: flex; margin-bottom: .5rem; border-bottom: 1px solid #e5e7eb; }

@media (min-width: 640px) {
  .demo-header { padding-right: 1.75rem; padding-left: 1.75rem; }
  .calendar-main { padding: 1rem 1.25rem; }
  .calendar-shell { padding: 1rem; }
  #person-switcher { display: none; }
}

@keyframes connection-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50% { opacity: 0.1; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12); }
}

@media (max-width: 639px) {
  .app-shell { display: block; }
  .app-sidebar { position: static; height: auto; min-height: 0; padding: 10px 12px; border-right: 0; border-bottom: 1px solid #e5e7eb; }
  .app-sidebar__brand { padding: 0 2px 10px; }
  .app-sidebar__brand-name, .app-sidebar__preview, .app-sidebar__toggle { display: none; }
  .app-sidebar__nav { flex-direction: row; gap: 3px; overflow-x: auto; }
  .app-sidebar__link { flex: 0 0 auto; min-height: 36px; padding: 0 9px; font-size: 0.75rem; }
  .app-sidebar__link--settings { margin-top: 0; margin-left: auto; }
  .app-sidebar__icon { width: 18px; font-size: 0.95rem; }
  .app-content { min-height: calc(100vh - 96px); }
  .demo-header { padding: 12px; align-items: flex-start; }
  .connection-status { max-width: 120px; font-size: 0.65rem; line-height: 1.4; }
  .demo-header__actions { gap: 8px; }
  .today-summary { display: none; }
  #business-name { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .connection-dot--connected { animation: none; }
}
