/* Teams + team lead view (tracker pl10, pl11). Own file for the same reason
   teams.js is: styles.css is written by several sessions at once.
   ⚠ styles.css has a GLOBAL input/select rule (width:100%, 12px padding,
   white box) that also hits date inputs. The inline "record filing" date
   input below overrides it explicitly; checkboxes use .consent-check, which
   already does. */

.teams-panel {
  display: grid;
  gap: 12px;
}

.team-head h3,
.teams-panel > h3 {
  margin: 0;
}

.team-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.team-status {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--lake-dark);
}

.team-status.error {
  color: #b42318;
}

.team-muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.team-line,
.team-note {
  margin: 0;
  font-size: 0.9rem;
}

.team-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.team-notice {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(8, 112, 122, 0.28);
  border-left: 4px solid var(--lake-dark);
  border-radius: 8px;
  background: #f4faf9;
}

.team-notice h4,
.team-notice p {
  margin: 0;
}

.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--lake-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.team-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(8, 112, 122, 0.16);
  border-radius: 8px;
  background: #fff;
}

.team-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.team-card-head h4 {
  margin: 0 0 2px;
}

.team-members,
.team-filings {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

.team-due {
  color: var(--lake-dark);
}

.team-overdue {
  color: #b42318;
  font-weight: 700;
}

.team-filed {
  color: var(--muted);
}

.team-file-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-left: 6px;
}

.team-file-form input[type="date"] {
  width: auto;
  min-width: 0;
  padding: 4px 8px;
  font-size: 0.82rem;
}

.team-editor {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fbfa;
}

.team-checklist {
  max-height: 320px;
  overflow: auto;
  display: grid;
  gap: 2px;
}

.team-create {
  display: grid;
  gap: 6px;
  max-width: 520px;
}

.team-ended {
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.25);
  border-radius: 8px;
  background: #fff7f6;
}

.team-ended h4 {
  margin: 0 0 4px;
}

.team-table-wrap {
  overflow-x: auto;
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.team-table th,
.team-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(8, 112, 122, 0.12);
  text-align: left;
}

.team-table tr.is-selected {
  background: #f4faf9;
}

.team-detail h4 {
  margin: 8px 0 6px;
}

.team-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.team-detail-grid h5 {
  margin: 0 0 4px;
}

.team-detail-grid ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  .team-card-head {
    flex-direction: column;
  }
}

/* ---- My Teams (My Agents tab), 2026-09-30 --------------------------------
   Card per team: name + TREC pill, lead line, any filing owed, team totals,
   members (each opens the agent's profile), and a Manage drawer holding the
   editors and filings so the overview stays quiet. */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 12px;
}

.team-card.is-managing {
  grid-column: 1 / -1;
  border-color: rgba(8, 112, 122, 0.4);
}

.team-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.team-card-title h4 {
  margin: 0;
}

.team-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.team-pill-ok {
  background: #e3f3ee;
  color: #1d5e48;
}

.team-pill-lead {
  background: var(--lake-dark);
  color: #fff;
}

.team-pill-wait {
  background: #fff4e0;
  color: #8a5300;
}

.team-pill-muted {
  background: #eef1f0;
  color: #455350;
}

.team-alert {
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff4e0;
  color: #8a5300;
  font-size: 0.84rem;
  font-weight: 700;
}

.team-alert.is-overdue {
  background: #fdecea;
  color: #b42318;
}

.team-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-stat {
  display: grid;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f4faf9;
}

.team-stat strong {
  font-size: 1.05rem;
  color: var(--lake-dark);
}

.team-stat span {
  font-size: 0.74rem;
  color: var(--muted);
}

.team-stats-note {
  margin: 0;
  font-size: 0.76rem;
}

.team-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.team-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid rgba(8, 112, 122, 0.08);
}

.team-member-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--lake-dark);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.team-member-link:hover,
.team-member-link:focus-visible {
  text-decoration: underline;
}

.team-manage {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(8, 112, 122, 0.14);
}

.team-subhead {
  margin: 0;
  font-size: 0.86rem;
}
