/* ============================================================
   TEAMS[] Styles · Bona Vita® Portal · Schritt 6
   ============================================================ */

#teamsRoot {
  padding: 24px 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.teams-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 0 4px;
  flex-wrap: wrap;
}
.teams-header h2 {
  margin: 0 0 4px;
  color: #0f1d3f;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.teams-header__sub {
  margin: 0;
  color: #5a6170;
  font-size: 0.92rem;
  max-width: 640px;
  line-height: 1.5;
}
.teams-header__reset {
  background: transparent;
  border: 1px solid #d9c9a8;
  color: #8a6a3c;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}
.teams-header__reset:hover {
  background: #faf6ed;
  border-color: #b8945a;
  color: #0f1d3f;
}

/* Grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

/* Team Card */
.team-card {
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 29, 63, 0.04);
  transition: box-shadow .2s ease, transform .2s ease;
}
.team-card:hover {
  box-shadow: 0 4px 14px rgba(15, 29, 63, 0.08);
}

.team-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef0f3;
}
.team-card__icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 400;
  flex-shrink: 0;
}
.team-card__title { flex: 1; min-width: 0; }
.team-card__title h3 {
  margin: 0 0 2px;
  color: #0f1d3f;
  font-size: 1.05rem;
  font-weight: 600;
}
.team-card__sub {
  color: #7a8294;
  font-size: 0.82rem;
  line-height: 1.4;
  display: block;
}
.team-card__count {
  background: #f4f6fa;
  color: #5a6170;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Members List */
.team-members {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-member {
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fcfcfd;
  transition: background .15s ease, border-color .15s ease;
}
.team-member:hover {
  background: #f9fafc;
  border-color: #dfe3ea;
}
.team-member--absent {
  opacity: 0.62;
  background: #f9f7f1;
  border-color: #e9dfc9;
}

.team-member__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.team-member__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}
.team-member__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.team-member__body strong {
  color: #0f1d3f;
  font-weight: 600;
  font-size: 0.95rem;
}
.team-member__role {
  color: #7a8294;
  font-size: 0.82rem;
}
.team-member__status {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 4px;
  align-self: flex-start;
  letter-spacing: 0.02em;
}
.team-member__status--active {
  background: #e8f3ec;
  color: #2d7a4f;
}
.team-member__status--absent {
  background: #f5ebd9;
  color: #8a6a3c;
}

.team-member__contact {
  margin-top: 6px;
  margin-left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: #5a6170;
}
.team-member__contact a {
  color: #1f3d6b;
  text-decoration: none;
}
.team-member__contact a:hover { text-decoration: underline; }

.team-member__actions {
  margin-top: 10px;
  margin-left: 18px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.team-member__btn {
  background: #fff;
  border: 1px solid #dfe3ea;
  color: #5a6170;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.team-member__btn:hover {
  border-color: #b8945a;
  color: #0f1d3f;
  background: #faf6ed;
}
.team-member__btn--del {
  padding: 4px 9px;
  font-size: 0.95rem;
  line-height: 1;
  color: #b83a3a;
  border-color: #ebd0d0;
}
.team-member__btn--del:hover {
  background: #fbeaea;
  border-color: #b83a3a;
  color: #b83a3a;
}

/* Add Button */
.team-card__add {
  width: 100%;
  background: transparent;
  border: 1.5px dashed #d9dde4;
  color: #7a8294;
  padding: 10px;
  border-radius: 7px;
  font-size: 0.87rem;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}
.team-card__add:hover {
  border-color: #b8945a;
  border-style: solid;
  color: #0f1d3f;
  background: #faf6ed;
}

/* Read-only Hint */
.teams-root--readonly .team-card__add,
.teams-root--readonly .team-member__actions {
  display: none;
}

/* Dialog */
.teams-dialog {
  position: fixed;
  inset: 0;
  background: rgba(15, 29, 63, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity .2s ease;
  padding: 20px;
}
.teams-dialog.is-open { opacity: 1; }

.teams-dialog__body {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform .2s ease;
}
.teams-dialog.is-open .teams-dialog__body {
  transform: translateY(0);
}

.teams-dialog__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid #eef0f3;
}
.teams-dialog__head h3 {
  margin: 0;
  color: #0f1d3f;
  font-size: 1.1rem;
  font-weight: 600;
}
.teams-dialog__close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #7a8294;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 5px;
  transition: background .15s ease;
}
.teams-dialog__close:hover {
  background: #f4f6fa;
  color: #0f1d3f;
}

.teams-dialog__form {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.teams-dialog__form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.teams-dialog__form label span {
  color: #5a6170;
  font-size: 0.82rem;
  font-weight: 500;
}
.teams-dialog__form input {
  padding: 9px 12px;
  border: 1px solid #dfe3ea;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #0f1d3f;
  background: #fff;
  transition: border-color .15s ease;
}
.teams-dialog__form input:focus {
  outline: none;
  border-color: #b8945a;
  box-shadow: 0 0 0 3px rgba(184, 148, 90, 0.14);
}

.teams-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
  border-radius: 0 0 10px 10px;
}
.teams-dialog__foot .btn {
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
  background: #0f1d3f;
  color: #fff;
  font-weight: 500;
}
.teams-dialog__foot .btn:hover { background: #1a2a55; }
.teams-dialog__foot .btn--ghost {
  background: #fff;
  color: #5a6170;
  border: 1px solid #dfe3ea;
}
.teams-dialog__foot .btn--ghost:hover {
  background: #f4f6fa;
  color: #0f1d3f;
}

/* Responsive */
@media (max-width: 640px) {
  .teams-grid { grid-template-columns: 1fr; }
  .teams-header { flex-direction: column; }
  .team-member__contact,
  .team-member__actions { margin-left: 0; }
}
