/* Team / sub-agent module — agent portal (Kladee brand) */
.content-card--team {
  padding: 0 !important;
  overflow: hidden;
}

.team-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  --team-control-h: 40px;
}

.team-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
}

.team-panel__head i,
.team-panel__head svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.75;
  color: var(--text-dark);
}

.team-panel__head h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.team-panel__body {
  padding: 16px 18px 18px;
}

.team-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 14px;
}

.team-toolbar .btn-primary,
.team-toolbar .btn-secondary {
  height: var(--team-control-h);
  min-height: var(--team-control-h);
  padding: 0 16px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
}

.team-toolbar__search {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
}

.team-toolbar__search > label {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-bottom: 10px;
  white-space: nowrap;
}

.team-toolbar__field {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.team-toolbar__field label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.team-toolbar__field select,
.team-toolbar__field input[type="search"],
.team-toolbar__field input[type="text"] {
  height: var(--team-control-h);
  min-height: var(--team-control-h);
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  line-height: 1.2;
  background: #fff;
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.team-toolbar__field select:focus,
.team-toolbar__field input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(61, 184, 138, 0.15);
}

.team-toolbar__field select {
  min-width: 140px;
}

.team-toolbar__field input[type="search"],
.team-toolbar__field input[type="text"] {
  min-width: 160px;
}

.team-toolbar__field--action {
  flex: 0 0 auto;
}

.team-toolbar__field--action label {
  visibility: hidden;
}

.team-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

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

.team-table th,
.team-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.team-table th {
  border-bottom-width: 1px;
}

.team-table td {
  border-bottom: 1px solid var(--border);
}

.team-table tr:last-child td {
  border-bottom: none;
}

.team-table thead th {
  font-weight: 600;
  color: var(--text-dark);
  background: var(--bg-page);
  white-space: nowrap;
}

.team-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.team-table tbody tr:hover {
  background: var(--accent-green-soft);
}

.team-table .col-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.team-table .col-status {
  white-space: nowrap;
}

.team-table .btn-secondary.btn-sm {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.team-pagination {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.team-pagination .pagination-bar {
  margin-top: 0;
}

.team-pagination .pagination-info {
  font-size: 0.85rem;
}

/* ── Team modal ── */
.team-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}

.team-modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.team-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.team-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
}

.team-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition);
}

.team-modal__close:hover {
  color: var(--text-dark);
}

.team-modal__tabs {
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
}

.team-modal__tab {
  display: inline-block;
  margin-bottom: -1px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: default;
}

.team-modal__tab.is-active {
  border-color: var(--border);
  border-bottom-color: #fff;
  background: #fff;
  color: var(--text-dark);
  font-weight: 600;
}

.team-modal__body {
  padding: 20px 20px 8px;
}

.team-form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.team-form-row label {
  text-align: right;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}

.team-form-row input,
.team-form-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.team-form-row input:focus,
.team-form-row textarea:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(61, 184, 138, 0.15);
}

.team-form-row textarea {
  min-height: 72px;
  resize: vertical;
}

.team-form-row--textarea {
  align-items: start;
}

.team-form-row--textarea label {
  padding-top: 8px;
}

.team-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-page);
  border-top: 1px solid var(--border);
}

.team-modal__footer .btn-primary,
.team-modal__footer .btn-secondary {
  min-width: 100px;
  justify-content: center;
}

@media (max-width: 768px) {
  .team-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .team-toolbar__search {
    flex-direction: column;
    align-items: stretch;
  }

  .team-toolbar__search > label {
    padding-bottom: 0;
  }

  .team-form-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .team-form-row label {
    text-align: left;
  }
}
