:root {
  --bg: #121826;
  --surface: #1B2436;
  --teal: #14B8A6;
  --amber: #F59E0B;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --danger: #EF4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 72px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.app-header__title {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  flex: 1;
  margin: 0;
}

.app-header__actions {
  display: flex;
  gap: 0.25rem;
}

.badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--danger);
}

.search-bar {
  padding: 0 0 0.75rem;
}

.search-bar input {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: none;
  background-color: var(--surface);
  color: var(--text-primary);
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.app-main {
  padding: 0 1rem;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-toolbar h2 {
  margin: 0.5rem 0;
  font-size: 1.05rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-grid__weekday {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.25rem 0;
}

.calendar-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  background-color: transparent;
  transition: background-color 300ms ease, opacity 300ms ease, border-color 300ms ease;
  border: 2px solid transparent;
  position: relative;
}

.calendar-cell--empty {
  cursor: default;
}

.calendar-cell--selected {
  background-color: var(--teal);
  color: var(--bg);
  font-weight: 600;
}

.calendar-cell--full-match {
  border-color: var(--teal);
}

.calendar-cell--partial-match::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--amber);
}

.calendar-cell--no-match {
  opacity: 0.3;
}

.status-view {
  padding-top: 0.5rem;
}

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
}

.status-row--dimmed {
  opacity: 0.5;
}

.status-row__avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.status-row__badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  transform: scale(0);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.status-row__badge--loaded {
  transform: scale(1);
}

.status-row__badge--available {
  background-color: #22C55E;
}

.status-row__badge--unavailable {
  background-color: var(--text-secondary);
}

.status-row__info {
  flex: 1;
}

.status-row__name {
  font-weight: 500;
}

.status-row__relationship {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.status-row__pill {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background-color: var(--surface);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.status-row__checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.status-row__checkbox:checked {
  transform: scale(1.05);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn--primary {
  background-color: var(--teal);
  color: var(--bg);
}

.btn--outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-secondary);
}

.btn--floating {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background-color: var(--surface);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.bottom-nav__item {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  padding: 0.5rem 0 0.6rem;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.bottom-nav__item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav__item--active {
  color: var(--teal);
}

.badge-count {
  position: absolute;
  top: 2px;
  right: 20%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background-color: var(--danger);
  color: var(--text-primary);
  font-size: 0.65rem;
  line-height: 16px;
}

.bottom-sheet {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms ease, visibility 0s linear 400ms;
}

.bottom-sheet.open {
  visibility: visible;
  opacity: 1;
  transition: opacity 300ms ease;
}

.bottom-sheet__panel {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  background-color: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1rem;
  transform: translateY(100%);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet.open .bottom-sheet__panel {
  transform: translateY(0);
}

.bottom-sheet__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.field-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin: 0.75rem 0 0.25rem;
}

#booking-title,
#booking-description {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: none;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: inherit;
}

#booking-description {
  min-height: 80px;
  resize: vertical;
}

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-view__panel {
  width: 100%;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-view__logo {
  color: var(--teal);
  margin: 0 auto 0.25rem;
  width: 64px;
  height: 64px;
}

.login-view__logo svg {
  width: 100%;
  height: 100%;
}

.login-view__title {
  margin: 0;
  font-size: 1.75rem;
}

.login-view__tagline {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn--provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background-color: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tab-view {
  padding-top: 0.25rem;
}

.events-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.event-card {
  background-color: var(--surface);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.event-card__title {
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.event-card__date {
  color: var(--teal);
  font-size: 0.8rem;
  margin: 0 0 0.35rem;
}

.event-card__detail {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

.empty-note {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem 0;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem 0;
  text-align: center;
}

.profile-card__avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  border: 2px solid var(--teal);
  margin-bottom: 0.5rem;
}

.profile-card__name {
  margin: 0;
  font-size: 1.25rem;
}

.profile-card__detail {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.profile-card__signout {
  margin-top: 1.25rem;
  text-decoration: none;
}
