/* Команда — отдельный внутренний контур, спокойнее и плотнее клиентской очереди. */
.team-workspace {
  min-height: 100%;
  padding: 28px;
  background: #F4F7FA;
}

.team-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px;
}

.team-page-head h1,
.team-task-detail h2,
.team-create-card h2,
.team-library-card h2,
.team-regulation-card h2 {
  margin: 0;
  color: #17223A;
}

.team-page-head h1 { font-size: 30px; line-height: 1.1; }
.team-page-head p,
.team-create-card > p,
.team-task-detail p { margin: 7px 0 0; color: #687991; line-height: 1.48; }

.team-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.team-summary span,
.team-priority-label,
.team-kicker,
.team-library-card > span,
.team-regulation-card > span {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 10px;
  border-radius: 999px;
  background: #EAF1F7;
  color: #5B6F89;
  font-size: 12px;
  font-weight: 700;
}
.team-summary b { color: #17223A; margin-right: 4px; }

.team-deals-layout {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(410px, 1.2fr) minmax(280px, .72fr);
  gap: 16px;
  align-items: start;
}

.team-deals-list,
.team-detail-wrap,
.team-create-card,
.team-chat-card,
.team-library-card,
.team-regulation-card {
  border: 1px solid #E0E8F0;
  border-radius: 18px;
  background: #FFF;
  box-shadow: 0 10px 28px rgba(27, 44, 72, .05);
}
.team-deals-list { overflow: hidden; }
.team-list-toolbar { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border-bottom: 1px solid #E8EEF4; }
.team-task-list { max-height: calc(100vh - 255px); overflow: auto; padding: 8px; }
.team-task-row { width: 100%; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 10px; align-items: center; text-align: left; padding: 13px 11px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.team-task-row:hover { background: #F4F8FA; }
.team-task-row.is-selected { background: #E7F8F5; }
.team-priority { width: 7px; height: 34px; border-radius: 999px; background: #A7B5C5; }
.priority-low { background: #94A3B8; color: #64748B; }
.priority-normal { background: #55B7D9; color: #237A9A; }
.priority-high { background: #F0A64B; color: #A45605; }
.priority-urgent { background: #E66D6D; color: #AD3030; }
.team-task-row-copy { min-width: 0; display: grid; gap: 4px; }
.team-task-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #17223A; font-size: 14px; }
.team-task-row small { color: #71829A; font-size: 12px; line-height: 1.35; }
.team-task-row em { color: #70829A; font-style: normal; font-size: 12px; font-weight: 700; }

.team-task-detail { padding: 24px; }
.team-detail-head { display: flex; justify-content: space-between; gap: 16px; }
.team-detail-head h2 { margin-top: 5px; font-size: 24px; }
.team-kicker { min-height: 24px; background: #E8F8F4; color: #118C7D; }
.team-task-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; padding: 12px 0; border-top: 1px solid #E8EEF4; border-bottom: 1px solid #E8EEF4; color: #73839A; font-size: 12px; }
.team-task-meta span { display: grid; gap: 4px; }
.team-task-meta b { color: #24324A; font-size: 14px; }
.team-detail-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.team-detail-section { margin-top: 24px; }
.team-detail-section h3 { margin: 0 0 10px; color: #263752; font-size: 15px; }
.team-check-progress { margin-bottom: 8px; color: #73839A; font-size: 12px; }
.team-check-item { width: 100%; display: grid; grid-template-columns: 22px 1fr; gap: 9px; align-items: center; margin: 6px 0; padding: 10px; border: 1px solid #E2EAF1; border-radius: 10px; background: #FFF; text-align: left; cursor: pointer; color: #22314A; }
.team-check-item span { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #B7C5D5; border-radius: 5px; color: #FFF; }
.team-check-item.is-done { background: #F1FBF8; color: #6D8196; text-decoration: line-through; }
.team-check-item.is-done span { border-color: var(--primary); background: var(--primary); }
.team-comments { display: grid; gap: 9px; }
.team-comments article { padding: 11px; border-radius: 10px; background: #F6F8FA; }
.team-comments strong { color: #263752; font-size: 13px; }
.team-comments small { margin-left: 8px; color: #8290A3; font-size: 11px; }
.team-comments p { margin: 5px 0 0; color: #44546A; font-size: 13px; white-space: pre-wrap; }
.team-comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; align-items: end; }
.team-comment-form textarea { min-height: 64px; }
.team-muted { color: #8090A5; font-size: 13px; }
.team-detail-empty { min-height: 460px; display: grid; place-content: center; text-align: center; padding: 24px; border: 1px dashed #D4E0EA; border-radius: 18px; color: #75879E; background: #FFF; }
.team-detail-empty span { width: 42px; margin: 0 auto 10px; color: #39BBA8; }
.team-detail-empty h3 { margin: 0; color: #34445B; }
.team-detail-empty p { max-width: 280px; margin: 7px 0 0; }

.team-create-card { padding: 20px; }
.team-create-card h2 { font-size: 18px; }
.team-create-card form { display: grid; gap: 12px; margin-top: 16px; }
.team-create-card .field { margin: 0; }
.team-create-card .textarea { min-height: 82px; }
.team-single-workspace { max-width: 1320px; }
.team-chat-card { overflow: hidden; }
.team-chat-stream { min-height: 440px; max-height: calc(100vh - 285px); overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #F8FAFC; }
.team-message { align-self: flex-start; max-width: min(680px, 84%); padding: 11px 13px; border-radius: 14px 14px 14px 3px; background: #FFF; border: 1px solid #E2EAF1; }
.team-message.is-own { align-self: flex-end; border-color: #BCECE4; border-radius: 14px 14px 3px 14px; background: #EDFBF8; }
.team-message div { display: flex; gap: 8px; align-items: baseline; }
.team-message strong { color: #263752; font-size: 13px; }
.team-message small { color: #7A8CA1; font-size: 11px; }
.team-message p { margin: 5px 0 0; color: #34445B; white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.team-chat-composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px; border-top: 1px solid #E1E9F0; background: #FFF; align-items: end; }
.team-chat-composer textarea { min-height: 58px; }

.team-library-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .48fr); gap: 18px; align-items: start; }
.team-library-list,.team-regulations-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.team-library-card,.team-regulation-card { padding: 20px; }
.team-library-card h2,.team-regulation-card h2 { margin-top: 8px; font-size: 18px; }
.team-library-card p,.team-regulation-card p { color: #6B7D94; line-height: 1.45; font-size: 13px; }
.team-library-card ol { margin: 14px 0 0; padding-left: 20px; color: #405168; font-size: 13px; line-height: 1.65; }
.team-regulation-card p { color: #405168; white-space: pre-wrap; }
.team-regulation-card small { display: block; margin-top: 16px; color: #8290A3; font-size: 11px; }
.team-regulation-editor { min-height: 220px !important; }

.team-notification-root {
  position: relative;
  display: inline-flex;
}

.team-notifications-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 10px);
  left: -8px;
  width: min(340px, calc(100vw - 28px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(36, 50, 74, 0.18);
}

.team-notifications-popover > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px 12px;
  border-bottom: 1px solid var(--line);
}

.team-notifications-popover header strong,
.team-notifications-popover header small,
.team-notification-item b,
.team-notification-item span,
.team-notification-item small {
  display: block;
}

.team-notifications-popover header strong {
  color: var(--text-primary);
  font-size: 14px;
}

.team-notifications-popover header small {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 11px;
}

.team-notifications-popover > header > span {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  place-items: center;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: var(--primary-soft);
  border-radius: 999px;
}

.team-notification-list {
  max-height: 316px;
  overflow: auto;
}

.team-notification-item {
  width: 100%;
  padding: 12px 15px;
  color: var(--text-primary);
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.team-notification-item:hover {
  background: var(--primary-soft);
}

.team-notification-item b {
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-notification-item span,
.team-notification-item small {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.team-notification-item small {
  color: var(--text-secondary);
  font-size: 10px;
}

.team-notification-empty {
  margin: 0;
  padding: 20px 15px;
  color: var(--text-secondary);
  font-size: 12px;
}

.team-notification-all {
  width: 100%;
  min-height: 42px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  background: #fff;
  border: 0;
  cursor: pointer;
}

.team-notification-all:hover {
  background: var(--primary-soft);
}

@media (max-width: 1320px) {
  .team-deals-layout { grid-template-columns: minmax(270px,.65fr) minmax(0,1fr); }
  .team-create-card { grid-column: 1 / -1; }
  .team-create-card form { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .team-create-card form > .field:first-child,.team-create-card form > .field:nth-child(2),.team-create-card form > button { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .team-workspace { padding: 12px; }
  .team-page-head { flex-direction: column; }
  .team-page-head h1 { font-size: 25px; }
  .team-deals-layout,.team-library-layout,.team-library-list,.team-regulations-list { grid-template-columns: 1fr; }
  .team-task-list { max-height: 340px; }
  .team-task-detail,.team-create-card { padding: 16px; }
  .team-create-card form { grid-template-columns: 1fr; }
  .team-task-meta,.team-chat-composer,.team-comment-form { grid-template-columns: 1fr; }
  .team-chat-stream { min-height: 370px; max-height: none; }
}
