/* Patients Page */

.patients {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.patients-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background-color: var(--c-popup-bg);
  border-bottom: 1px solid var(--c-border);
}

.patients-header--sticky {
  position: sticky;
  top: 0;
}

.patients-content {
  flex: 1;
  padding: 2rem;
}

.patients-top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.patients-top-bar__search {
  width: 384px;
}

.patients-top-bar__search .base-searchbar-underline__input {
  font-size: 2.5rem;
}

/* Filter Buttons */
.patients-top-bar__filters {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.25rem;
}

.patients-top-bar__filter {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--c-border);
  background-color: var(--c-app-bg);
  color: var(--c-base-subtitle-text);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.patients-top-bar__filter:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.patients-top-bar__filter--active {
  background-color: var(--c-brand);
  border-color: var(--c-brand);
  color: var(--c-brand-text);
}

.patients-top-bar__filter--active:hover {
  color: var(--c-brand-text);
  opacity: 0.9;
}

.patients-top-bar__filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 0.625rem;
  background-color: var(--c-border);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--c-base-subtitle-text);
  margin-left: 0.25rem;
}

.patients-top-bar__filter--active .patients-top-bar__filter-count {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--c-brand-text);
}

.patients-top-bar__add-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  border: none;
  background-color: var(--c-brand);
  color: var(--c-brand-text);
  font-size: 1.375rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.patients-top-bar__add-btn:hover {
  opacity: 0.9;
}

/* Patient List */

.patients-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.patients-list__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 0.625rem;
  border: 1px solid var(--c-border);
  transition: background-color 0.1s ease;
  cursor: pointer;
}

.patients-list__item:hover {
  background-color: var(--c-brand-highlight);
}

.patients-list__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--c-brand);
  color: var(--c-brand-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.patients-list__avatar--good {
  background-color: var(--c-severity-good);
}

.patients-list__avatar--bad {
  background-color: var(--c-severity-bad);
  color: #422006;
}

.patients-list__avatar--severe {
  background-color: var(--c-severity-severe);
}

.patients-list__avatar--critical {
  background-color: var(--c-severity-critical);
}

.patients-list__info {
  flex: 1;
  min-width: 0;
}

.patients-list__name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--c-base-text);
}

.patients-list__email {
  font-size: 0.8125rem;
  color: var(--c-base-subtitle-text);
  margin-top: 0.125rem;
}

.patients-list__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--c-base-subtitle-text);
  font-size: 0.9375rem;
}

.patients-list__badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

/* Active Plan Badge */
.patients-list__plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  background-color: var(--c-brand-highlight);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--c-brand);
  white-space: nowrap;
}

.patients-list__plan-badge--none {
  background-color: var(--c-border);
  color: var(--c-base-subtitle-text);
}

.patients-list__doctor-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  background-color: var(--c-border);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--c-base-subtitle-text);
  white-space: nowrap;
}

/* Plan Button (shown on hover) */
.patients-list__plan-btn {
  display: none;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  background-color: var(--c-brand);
  color: var(--c-brand-text);
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.patients-list__plan-btn:hover {
  opacity: 0.9;
}

.patients-list__plan-btn--continue {
  background-color: transparent;
  color: var(--c-brand);
  border: 1px solid var(--c-brand);
}

.patients-list__plan-btn--continue:hover {
  background-color: var(--c-brand-highlight);
}

.patients-list__plan-btn--danger {
  background-color: transparent;
  color: var(--c-error);
  border: 1px solid var(--c-error);
}

.patients-list__plan-btn--danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  opacity: 1;
}

.patients-list__item:hover .patients-list__plan-btn {
  display: flex;
}

/* Login Code Button */
.patients-list__login-code {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  background-color: transparent;
  color: var(--c-base-subtitle-text);
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  min-width: 4rem;
}

.patients-list__login-code:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.patients-list__login-code--generated {
  display: flex;
  font-family: monospace;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  background-color: var(--c-brand-highlight);
  border-color: var(--c-brand);
  color: var(--c-brand);
  cursor: default;
}

.patients-list__login-code--generated:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.patients-list__item:hover .patients-list__login-code {
  display: flex;
}

/* Edit Button */
.patients-list__edit-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  background: none;
  border: 1px solid var(--c-border);
  color: var(--c-base-subtitle-text);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.patients-list__edit-btn:hover {
  border-color: var(--c-brand);
  color: var(--c-brand);
}

.patients-list__item:hover .patients-list__edit-btn {
  display: flex;
}

/* Search results overlay */
.patients-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
