/* Team — expired contracts stay out of the primary workspace until requested. */
#main:has(.team-heading) .team-archive-actions{flex-wrap:wrap;gap:8px}
#main:has(.team-heading) .team-history-button{background:var(--violet);border-color:var(--violet);color:var(--surface);gap:7px}
#main:has(.team-heading) .team-history-button:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
#modal:has(.team-history-dialog){width:min(860px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);overflow-y:auto;border:1px solid var(--line);border-radius:var(--ds-radius-xl);font-family:var(--font-ui)}
#modal .team-history-profile{display:flex;align-items:center;gap:12px;margin-bottom:18px}
#modal .team-history-profile .avatar{background:#f5f1ff;color:var(--violet-text);border-radius:var(--ds-radius-lg)}
#modal .team-history-profile strong{font-size:15px;font-weight:600}
#modal .team-history-profile small{display:block;margin-top:3px;color:var(--muted);font-size:12px}
#modal .team-history-summary{display:flex;flex-wrap:wrap;gap:10px 24px;padding:13px 16px;border:1px solid var(--line);border-radius:var(--ds-radius-lg);background:var(--soft);color:var(--muted);font-size:13px}
#modal .team-history-summary strong{color:var(--ink);font-variant-numeric:tabular-nums}
#modal .team-history-caption{margin:12px 0 18px;color:var(--muted);font-size:12px}
#modal .team-history-table-wrap{border:1px solid var(--line);border-radius:var(--ds-radius-lg);overflow:hidden}
#modal .team-history-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px}
#modal .team-history-table th{padding:12px 14px;background:var(--soft);color:var(--muted);text-align:left;font-size:11px;font-weight:600;text-transform:uppercase}
#modal .team-history-table th:first-child{width:18%}
#modal .team-history-table th:nth-child(2){width:25%}
#modal .team-history-table th:nth-child(3){width:35%}
#modal .team-history-table th:last-child{width:22%}
#modal .team-history-table td{padding:14px;border-top:1px solid var(--line);color:var(--ink);vertical-align:top;overflow-wrap:anywhere}
#modal .team-history-table td strong{font-weight:500}
#modal .team-history-table td small{display:block;margin-top:4px;color:var(--muted);font-size:12px}
#modal .team-history-appointment-note{white-space:pre-wrap}
#modal .team-history-state{display:inline-block;padding:4px 8px;border-radius:var(--ds-radius-pill);background:var(--soft);color:var(--muted);font-size:11px;font-weight:500}
#modal .team-history-state.done{background:var(--ds-success-bg);color:var(--ds-success)}
#modal .team-history-state.cancel{background:var(--ds-danger-bg);color:var(--danger-text)}
#modal .team-history-state.scheduled{background:var(--ds-info-bg);color:var(--ds-info)}
#modal .team-history-state.progress{background:var(--ds-warning-bg);color:var(--ds-warning)}
#modal .team-history-empty{padding:20px 16px;border:1px solid var(--line);border-radius:var(--ds-radius-lg);color:var(--muted);font-size:13px}
#modal .team-history-member-note{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
#modal .team-history-member-note h3{font-size:14px;font-weight:600}
#modal .team-history-member-note p{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted);font-size:13px}
@media(max-width:600px){
 #modal:has(.team-history-dialog){width:calc(100vw - 24px);padding:20px}
 #modal .team-history-table thead{display:none}
 #modal .team-history-table tbody{display:block}
 #modal .team-history-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px;border-top:1px solid var(--line)}
 #modal .team-history-table tr:first-child{border-top:0}
 #modal .team-history-table td{display:block;border:0;padding:0}
 #modal .team-history-table td::before{content:attr(data-label);display:block;margin-bottom:4px;color:var(--muted);font-size:10px;text-transform:uppercase}
}

#main:has(.team-heading) .team-expired-archive{
  margin-top:16px;
}
#main:has(.team-heading) .team-expired-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  width:100%;
  min-height:46px;
  padding:11px 14px;
  border:1px solid #e9edf3;
  border-radius:12px;
  background:#f9fbfd;
  color:#8a96a8;
  font-family:var(--font-ui);
  font-size:13px;
  text-align:left;
  cursor:pointer;
}
#main:has(.team-heading) .team-expired-toggle:hover,#main:has(.team-heading) .team-expired-toggle:focus-visible{
  border-color:#dbe1ea;
  background:#f6f8fb;
  color:#6f7c90;
}
#main:has(.team-heading) .team-expired-toggle:focus-visible{
  outline:3px solid rgba(124,87,255,.11);
  outline-offset:2px;
}
#main:has(.team-heading) .team-expired-toggle-label{
  font-weight:500;
  letter-spacing:.005em;
}
#main:has(.team-heading) .team-expired-toggle-action{
  display:inline-flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
  color:#778499;
  font-weight:600;
}
#main:has(.team-heading) .team-expired-toggle-action svg{
  transition:transform .18s ease;
}
#main:has(.team-heading) .team-expired-archive.is-open .team-expired-toggle-action svg{
  transform:rotate(180deg);
}
#main:has(.team-heading) .team-expired-cards{
  margin-top:12px;
}
#main:has(.team-heading) .team-expired-cards[hidden]{
  display:none!important;
}
#main:has(.team-heading) .team-card-expired{
  opacity:.62;
  filter:saturate(.38);
  border-color:#e7ebf1!important;
  background:#fafbfc!important;
  box-shadow:none!important;
  transition:opacity .18s ease,border-color .18s ease,background .18s ease;
}
#main:has(.team-heading) .team-card-expired:hover,#main:has(.team-heading) .team-card-expired:focus-within{
  opacity:.82;
  border-color:#dce2ea!important;
  background:#fff!important;
}
#main:has(.team-heading) .team-card-expired .team-edit{
  border-color:#e2e6ec!important;
  background:#eef1f5!important;
  color:#7c8797!important;
  box-shadow:none!important;
}
#main:has(.team-heading) .team-card-expired .team-note-button,#main:has(.team-heading) .team-card-expired .textbtn.danger{
  color:#8f98a6!important;
}
#main:has(.team-heading) .team-expired-filter-results .team-card-expired{
  opacity:.86;
}
@media(max-width:700px){
  #main:has(.team-heading) .team-expired-toggle{
    align-items:flex-start;
  }
  #main:has(.team-heading) .team-expired-toggle-action{
    padding-top:1px;
  }
}
