/* Extra styling layered on top of styles.css: the owner-only chore-editing
   controls, member/assignment selects, achievement badges and leaderboard. */

/* "Add a household chore" form */
.chore-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.chore-form select, .assignment {
  padding: 13px;
  border: 1px solid #c9cec7;
  border-radius: 10px;
  background: white;
  font-size: 15px;
}
.assignment {
  max-width: 180px;
}
/* Shown only when "Custom…" frequency is selected; spans the full row
   instead of squeezing into the grid's last column. */
#new-interval-days {
  grid-column: 1 / -1;
}

/* Household name + owner-only "Rename" button/panel */
.household-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.household-name-row h2 {
  margin: 0;
}

/* Active household picker, shown in the household card only when a user
   belongs to more than one household. */
#switch-wrap {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
#switch-wrap select {
  margin-left: 6px;
  padding: 6px 8px;
  border: 1px solid #c9cec7;
  border-radius: 8px;
  background: white;
  font-size: 13px;
}

/* One row per chore: the checkbox/label button, the assignment dropdown, and
   (owner only) Edit/Remove buttons. */
.chore-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chore-row .chore {
  flex: 1;
}
.owner-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
button.tiny {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 8px;
}
button.danger {
  background: #f4e4e0;
  color: #8a4437;
}

/* Achievement badges */
.badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 10px 0 24px;
}
.badge {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eeece5;
  opacity: 0.62;
}
.badge.unlocked {
  background: #e4eee6;
  border-color: #b8cbbb;
  opacity: 1;
}
.badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #daddd7;
  color: #65726a;
  font-weight: 900;
  margin-bottom: 10px;
}
.unlocked .badge-icon {
  background: var(--sage);
  color: white;
}
.badge h4 {
  margin: 0 0 5px;
}
.badge p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.progress {
  height: 5px;
  background: #d6d9d4;
  border-radius: 99px;
  margin-top: 10px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--sage);
}

.leaderboard div {
  display: flex;
  justify-content: space-between;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
}

/* Admin tab: household list with a status pill and grant/revoke button per row. */
.admin-table {
  border-top: 1px solid var(--line);
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 5px;
  border-bottom: 1px solid var(--line);
}
.admin-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.admin-row-main small {
  color: var(--muted);
}
.admin-status {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-status.ok {
  background: #e4eee6;
  color: #3f6a4c;
}
.admin-status.warn {
  background: #f5eede;
  color: #8a6a2f;
}
.admin-status.bad {
  background: #f4e4e0;
  color: var(--danger);
}

@media (max-width: 600px) {
  .chore-form {
    grid-template-columns: 1fr;
  }
  .badges {
    grid-template-columns: 1fr 1fr;
  }
  .chore-row {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-row {
    flex-wrap: wrap;
  }
  .assignment {
    max-width: none;
    margin-bottom: 10px;
  }
}
