/* Residents page — compact expandable cards */
.vp-mobile .layout--residents .content.residents-content-host {
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0)) !important;
}

.residents-page {
  --res-navy: #0f172a;
  --res-gold: #c8a968;
  --res-bg: #f7f9fc;
  --res-white: #fff;
  --res-border: #e6ecf2;
  --res-muted: #64748b;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  font-family: Vazirmatn, inherit;
}

.residents-page__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--res-muted);
}

.residents-page__add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
}

.residents-toolbar {
  min-height: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1.5px solid rgba(214, 169, 79, 0.28);
  border-radius: 14px;
  background: var(--res-white);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.residents-toolbar .ch-search-row__input {
  min-height: 42px;
  font-size: 13px;
}

.res-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.res-list__empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--res-muted);
}

.res-card {
  border-radius: 14px;
  border: 1px solid var(--res-border);
  background: var(--res-white);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.res-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.res-card__start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.res-card__avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--avatar-hue, 210), 48%, 36%);
  background: hsl(var(--avatar-hue, 210), 58%, 93%);
}

.res-card__avatar svg {
  display: block;
  flex-shrink: 0;
}

.res-card__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.res-card__name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.res-card__meta {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.res-card__end {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.res-card__pill {
  display: none;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 400px) {
  .res-card__pill {
    display: inline-flex;
  }
}

.res-card__pill--manager {
  background: #eff6ff;
  color: #1d4ed8;
}

.res-card__pill--active {
  background: #ecfdf5;
  color: #047857;
}

.res-card__pill--warn {
  background: #fff7ed;
  color: #c2410c;
}

.res-card__pill--muted {
  background: #f3f4f6;
  color: #6b7280;
}

.res-card__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--res-bg);
  color: var(--res-muted);
  cursor: pointer;
}

.res-card__more:hover,
.res-card.is-open .res-card__more {
  background: rgba(200, 169, 104, 0.15);
  color: var(--res-navy);
}

.res-card__panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  border-top: 1px solid transparent;
  background: linear-gradient(180deg, var(--res-bg) 0%, rgba(247, 249, 252, 0.5) 100%);
}

.res-card.is-open .res-card__panel {
  max-height: 320px;
  opacity: 1;
  border-top-color: rgba(200, 169, 104, 0.22);
}

.res-card__panel-inner {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.res-card__detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--res-white);
  border: 1px solid var(--res-border);
  font-size: 12px;
}

.res-card__detail-label {
  color: var(--res-muted);
  font-weight: 500;
}

.res-card__detail-value {
  color: var(--res-navy);
  font-weight: 600;
}

.res-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.res-card__action {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}
